/* Audience occupies a complete row; controls cannot inherit tall text-input sizing.
   R27 (2026-09-22): cada caja de perfiles («Quién puede ver…», «Quién no debe
   verla») ocupa todo el ancho y sus perfiles se muestran en cuadrícula; antes
   cada caja usaba media fila y dejaba un gran hueco a la derecha. */
.academy-editor .academy-micro-audience {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-column: 1 / -1;
  gap: 16px;
  min-width: 0;
}
.academy-editor .academy-micro-audience > * { grid-column: 1 / -1; min-width: 0; }
.academy-editor .academy-micro-audience > fieldset { min-width: 0; margin: 0; }
.academy-editor .academy-acl-options > label,
.academy-editor .academy-scene-fields > .academy-answer-field {
  display: flex; flex-direction: row; align-items: flex-start; gap: 10px;
  min-width: 0; white-space: normal; overflow-wrap: anywhere;
}
.academy-editor input[type="checkbox"], .academy-editor input[type="radio"] {
  box-sizing: border-box; flex: 0 0 18px;
  width: 18px; height: 18px; min-width: 18px; min-height: 18px;
  max-width: 18px; max-height: 18px; padding: 0; margin: 2px 0 0;
  appearance: auto; accent-color: #007c89;
}
.academy-editor [data-microtask-form] [data-guided-builder] { grid-column: 1 / -1; min-width: 0; }
.academy-editor .academy-field-grid label > .academy-field-help { align-self: start; }
@media (max-width: 700px) {
  .academy-editor .academy-micro-audience { grid-template-columns: minmax(0, 1fr); }
}
.academy-editor {
  --academy-ink: #17233b;
  --academy-muted: #5f6b7f;
  --academy-line: #d8dee8;
  --academy-soft: #f4f7fa;
  --academy-blue: #15558f;
  --academy-blue-soft: #e7f1fa;
  --academy-green: #16724a;
  --academy-green-soft: #e6f5ed;
  --academy-amber: #9b5b08;
  --academy-amber-soft: #fff3d8;
  --academy-red: #a43131;
  --academy-red-soft: #fdeaea;
  --academy-orange: #df6c20;
  color: var(--academy-ink);
  background: #fff;
  min-width: 0;
  width: 100%;
}

.content-studio-view {
  padding: 0 !important;
}

.academy-editor *,
.academy-editor *::before,
.academy-editor *::after {
  box-sizing: border-box;
}

.academy-editor button,
.academy-editor input,
.academy-editor select,
.academy-editor textarea {
  color: inherit;
  font: inherit;
  letter-spacing: 0;
}

.academy-editor button {
  cursor: pointer;
}

.academy-editor button:disabled {
  cursor: not-allowed;
  opacity: .55;
}

.academy-editor-heading {
  align-items: end;
  background: #fff;
  border-bottom: 1px solid var(--academy-line);
  display: flex;
  gap: 24px;
  justify-content: space-between;
  padding: 24px 28px 20px;
}

.academy-editor-heading h1,
.academy-editor-titlebar h2,
.academy-editor-section-heading h3,
.academy-editor-welcome h2 {
  margin: 4px 0 6px;
  max-width: 760px;
  overflow-wrap: anywhere;
}

.academy-editor-heading h1 {
  font-size: 26px;
  line-height: 1.2;
}

.academy-editor-heading p,
.academy-editor-titlebar p,
.academy-editor-section-heading p,
.academy-empty-inline p,
.academy-empty-state p,
.academy-editor-welcome p {
  color: var(--academy-muted);
  line-height: 1.55;
  margin: 0;
}

.academy-editor-kicker {
  color: var(--academy-blue);
  display: block;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.academy-editor-heading-actions,
.academy-editor-actions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.academy-button-primary,
.academy-button-secondary,
.academy-button-danger,
.academy-icon-button {
  align-items: center;
  border-radius: 6px;
  display: inline-flex;
  font-weight: 750;
  justify-content: center;
  min-height: 40px;
  padding: 0 16px;
}

.academy-button-primary {
  background: var(--academy-blue);
  border: 1px solid var(--academy-blue);
  color: #fff !important;
}

.academy-button-secondary,
.academy-icon-button {
  background: #fff;
  border: 1px solid #bdc8d7;
}

.academy-button-danger {
  background: #fff;
  border: 1px solid #d7a6a6;
  color: var(--academy-red) !important;
}

.academy-icon-button {
  height: 36px;
  min-height: 36px;
  padding: 0 11px;
}

.academy-editor button:focus-visible,
.academy-editor input:focus-visible,
.academy-editor select:focus-visible,
.academy-editor textarea:focus-visible,
.academy-editor summary:focus-visible {
  outline: 3px solid rgba(21, 85, 143, .24);
  outline-offset: 2px;
}

.academy-editor-path {
  align-items: center;
  background: var(--academy-soft);
  border-bottom: 1px solid var(--academy-line);
  color: var(--academy-muted);
  display: flex;
  flex-wrap: wrap;
  font-size: 12px;
  gap: 10px;
  padding: 10px 28px;
}

.academy-editor-path i {
  border-right: 1px solid #8290a4;
  border-top: 1px solid #8290a4;
  display: block;
  height: 7px;
  transform: rotate(45deg);
  width: 7px;
}

.academy-editor-path strong {
  color: var(--academy-blue);
}

.academy-editor-context {
  border-bottom: 1px solid var(--academy-line);
  display: grid;
  grid-template-columns: minmax(190px, .8fr) minmax(220px, 1fr) minmax(300px, 1.35fr);
  min-height: 230px;
}

.academy-editor-context > details,
.academy-independent-list {
  border-right: 1px solid var(--academy-line);
  min-width: 0;
  padding: 0;
}

.academy-editor-context > :last-child {
  border-right: 0;
}

.academy-editor-context summary,
.academy-independent-list > header {
  align-items: center;
  background: #fff;
  border-bottom: 1px solid var(--academy-line);
  display: flex;
  gap: 9px;
  min-height: 58px;
  padding: 10px 14px;
}

.academy-editor-context summary {
  cursor: pointer;
  list-style: none;
}

.academy-editor-context summary::-webkit-details-marker {
  display: none;
}

.academy-editor-context summary > span,
.academy-independent-list > header > div > span {
  align-items: center;
  background: var(--academy-blue-soft);
  border-radius: 50%;
  color: var(--academy-blue);
  display: inline-flex;
  flex: 0 0 28px;
  font-size: 12px;
  font-weight: 800;
  height: 28px;
  justify-content: center;
}

.academy-editor-context summary small,
.academy-independent-list header small {
  color: var(--academy-muted);
  display: block;
  font-size: 11px;
}

.academy-independent-list > header {
  justify-content: space-between;
}

.academy-independent-list > header > div {
  align-items: center;
  display: grid;
  gap: 0 9px;
  grid-template-columns: 28px auto;
}

.academy-independent-list > header > div span {
  grid-row: 1 / 3;
}

.academy-context-list,
.academy-independent-list > div {
  max-height: 310px;
  overflow: auto;
  overscroll-behavior: contain;
}

.academy-catalog-search {
  align-items: end;
  background: #f7f9fb;
  border-bottom: 1px solid var(--academy-line);
  display: grid;
  gap: 8px;
  grid-template-columns: minmax(0, 1fr) auto;
  padding: 10px 12px;
  position: sticky;
  top: 0;
  z-index: 2;
}

.academy-catalog-search label { display: grid; gap: 4px; min-width: 0; }
.academy-catalog-search label span { color: var(--academy-muted); font-size: 10px; font-weight: 800; text-transform: uppercase; }
.academy-catalog-search input { min-width: 0; width: 100%; }
.academy-load-more { margin: 12px; width: calc(100% - 24px); }

.academy-context-item,
.academy-micro-item,
.academy-media-item {
  align-items: center;
  background: #fff;
  border: 0;
  border-bottom: 1px solid #e8ecf2;
  display: grid;
  gap: 10px;
  min-width: 0;
  padding: 12px 14px;
  text-align: left;
  width: 100%;
}

.academy-context-item {
  grid-template-columns: 30px minmax(0, 1fr);
}

.academy-context-item:hover,
.academy-micro-item:hover,
.academy-media-item:hover,
.academy-context-item.is-active,
.academy-micro-item.is-active,
.academy-media-item.is-active {
  background: var(--academy-blue-soft);
}

.academy-context-item.is-active,
.academy-micro-item.is-active,
.academy-media-item.is-active {
  box-shadow: inset 3px 0 var(--academy-blue);
}

.academy-context-symbol,
.academy-media-symbol {
  align-items: center;
  background: #edf1f5;
  border-radius: 5px;
  color: #455268;
  display: inline-flex;
  font-size: 11px;
  font-weight: 800;
  height: 30px;
  justify-content: center;
  width: 30px;
}

.academy-context-item span,
.academy-micro-item span,
.academy-media-item span {
  min-width: 0;
}

.academy-context-item strong,
.academy-micro-item strong,
.academy-media-item strong {
  display: block;
  font-size: 13px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.academy-context-item small,
.academy-micro-item small,
.academy-media-item small {
  color: var(--academy-muted);
  display: block;
  font-size: 11px;
  line-height: 1.4;
  margin-top: 3px;
  overflow-wrap: anywhere;
}

.academy-micro-item {
  grid-template-columns: 30px minmax(0, 1fr) auto;
}

.academy-micro-order {
  align-items: center;
  border: 1px solid #c9d3df;
  border-radius: 50%;
  display: inline-flex;
  font-size: 11px;
  font-weight: 800;
  height: 28px;
  justify-content: center;
  width: 28px;
}

.academy-status {
  border-radius: 999px;
  display: inline-flex;
  flex: 0 0 auto;
  font-size: 10px;
  font-weight: 800;
  line-height: 1;
  padding: 6px 8px;
  white-space: nowrap;
}

.academy-status-neutral,
.academy-status-draft {
  background: #edf1f5;
  color: #526078;
}

.academy-status-warning,
.academy-status-review {
  background: var(--academy-amber-soft);
  color: var(--academy-amber);
}

.academy-status-success,
.academy-status-approved,
.academy-status-live,
.academy-status-published {
  background: var(--academy-green-soft);
  color: var(--academy-green);
}

.academy-status-muted,
.academy-status-archived {
  background: #ececec;
  color: #666;
}

.academy-editor-main {
  background: var(--academy-soft);
  min-width: 0;
  padding: 0 0 40px;
}

.academy-micro-workspace,
.academy-editor-welcome {
  background: #fff;
  border-bottom: 1px solid var(--academy-line);
}

.academy-editor-welcome {
  min-height: 330px;
  padding: 72px 28px;
  text-align: center;
}

.academy-empty-symbol {
  align-items: center;
  background: var(--academy-blue-soft);
  border-radius: 7px;
  color: var(--academy-blue);
  display: inline-flex;
  font-size: 13px;
  font-weight: 900;
  height: 48px;
  justify-content: center;
  margin-bottom: 10px;
  width: 48px;
}

.academy-editor-titlebar,
.academy-editor-section-heading {
  align-items: start;
  display: flex;
  gap: 20px;
  justify-content: space-between;
  padding: 24px 28px 18px;
}

.academy-editor-titlebar h2 {
  font-size: 22px;
}

.academy-origin-context {
  background: #eef7fc;
  border-left: 4px solid var(--academy-blue);
  color: #263b55;
  margin: 0 28px 20px;
  padding: 14px 16px;
}

.academy-origin-context strong {
  display: block;
  margin-bottom: 4px;
}

.academy-origin-context p {
  margin: 0;
}

/* R42: la casilla de ampliar acceso va en línea con su texto; dentro de
   .academy-field-grid las etiquetas son columnas y la separaban. */
.academy-field-grid .academy-origin-context > label.academy-consent-check {
  align-items: flex-start;
  flex-direction: row;
  gap: 10px;
  margin-top: 10px;
}

/* R42: clave interna del curso, plegada y discreta en la tarjeta. */
.academy-course-technical {
  color: #536278;
  font-size: 12px;
  margin-top: 8px;
}

.academy-course-technical summary {
  cursor: pointer;
  width: fit-content;
}

.academy-course-technical p {
  margin: 4px 0 0;
  overflow-wrap: anywhere;
}

.academy-micro-form {
  padding: 0 28px 28px;
}

.academy-field-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.academy-field-grid label,
.academy-json-workbench label,
.academy-didactic-content {
  color: #354158;
  display: flex;
  font-size: 12px;
  font-weight: 750;
  gap: 6px;
  min-width: 0;
  flex-direction: column;
}

.academy-field-wide {
  grid-column: 1 / -1;
}

/* The course title is wrapped in .academy-help-field when field help mounts. */
[data-academy-module-form] .academy-field-grid > label:has(> input[name="title"]),
[data-academy-module-form] .academy-field-grid > .academy-help-field:has(> label > input[name="title"]),
.academy-didactic-builder .academy-field-grid > label:has(> textarea[name="didactic_takeaways"]) {
  grid-column: 1 / -1;
}

.academy-didactic-builder label:has(> .academy-field-help) {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 44px;
}

.academy-didactic-builder label:has(> .academy-field-help) > :is(input, select, textarea, small) {
  grid-column: 1 / -1;
}

.academy-didactic-builder label:has(> .academy-field-help) > .academy-field-help {
  grid-column: 2;
  grid-row: 1;
  justify-self: end;
  margin: -12px 0 0;
}

.academy-didactic-builder label:has(> .academy-field-help) > .academy-field-help[open] {
  grid-column: 1 / -1;
  grid-row: auto;
  justify-self: stretch;
  margin: 0;
}

.academy-editor input,
.academy-editor select,
.academy-editor textarea {
  background: #fff;
  border: 1px solid #bcc7d5;
  border-radius: 5px;
  min-width: 0;
  width: 100%;
}

.academy-editor input,
.academy-editor select {
  min-height: 42px;
  padding: 8px 10px;
}

.academy-editor textarea {
  line-height: 1.5;
  min-height: 88px;
  padding: 10px;
  resize: vertical;
}

.academy-didactic-content {
  margin-top: 18px;
}

.academy-didactic-builder,
.academy-advanced {
  border-top: 1px solid var(--academy-line);
  margin-top: 22px;
  padding-top: 20px;
}

.academy-advanced summary {
  color: var(--academy-blue);
  cursor: pointer;
  font-size: 12px;
  font-weight: 800;
  padding: 8px 0;
}

.academy-advanced > p {
  color: var(--academy-muted);
  font-size: 11px;
  margin: 0 0 10px;
}

.academy-advanced textarea {
  font-family: "Cascadia Code", Consolas, monospace;
  font-size: 12px;
}

.academy-didactic-content small,
.academy-json-workbench small,
.academy-subheading small {
  color: var(--academy-muted);
  font-size: 11px;
  font-weight: 500;
  line-height: 1.4;
}

.academy-didactic-content textarea,
.academy-json-workbench textarea {
  font-family: "Cascadia Code", Consolas, monospace;
  font-size: 12px;
  min-height: 180px;
  white-space: pre-wrap;
}

.academy-trace-panel {
  background: #f7fafc;
  border-bottom: 1px solid var(--academy-line);
  border-top: 1px solid var(--academy-line);
  display: grid;
  gap: 0;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin: 22px -28px 0;
}

.academy-trace-panel > div {
  border-right: 1px solid var(--academy-line);
  min-width: 0;
  padding: 14px 18px;
}

.academy-trace-panel > div:last-child {
  border-right: 0;
}

.academy-trace-panel span {
  color: var(--academy-muted);
  display: block;
  font-size: 10px;
  margin-bottom: 4px;
  text-transform: uppercase;
}

.academy-trace-panel strong {
  display: block;
  font-size: 12px;
  overflow-wrap: anywhere;
}

.academy-hash {
  font-family: Consolas, monospace;
}

.academy-micro-form > .academy-editor-actions {
  justify-content: flex-end;
  padding-top: 20px;
}

.academy-save-note,
.academy-production-state {
  color: var(--academy-muted);
  font-size: 11px;
  margin-right: auto;
}

.academy-editor-tooling {
  background: #fff;
  border-top: 10px solid var(--academy-soft);
}

.academy-editor-tabs {
  border-bottom: 1px solid var(--academy-line);
  display: flex;
  gap: 2px;
  overflow-x: auto;
  padding: 0 28px;
}

.academy-editor-tabs button {
  background: transparent;
  border: 0;
  border-bottom: 3px solid transparent;
  color: var(--academy-muted);
  font-weight: 750;
  min-height: 50px;
  padding: 0 14px;
  white-space: nowrap;
}

.academy-editor-tabs button.is-active {
  border-bottom-color: var(--academy-orange);
  color: var(--academy-ink);
}

.academy-authoring-section {
  min-width: 0;
  padding-bottom: 28px;
}

.academy-authoring-section > .academy-field-grid,
.academy-authoring-section > .academy-json-workbench,
.academy-authoring-section > .academy-editor-actions {
  margin-left: 28px;
  margin-right: 28px;
}

.academy-task-layout {
  border-top: 1px solid var(--academy-line);
  display: grid;
  grid-template-columns: minmax(230px, .7fr) minmax(0, 2fr);
}

.academy-task-list {
  border-right: 1px solid var(--academy-line);
  max-height: 760px;
  min-width: 0;
  overflow: auto;
}

.academy-task-item {
  align-items: center;
  background: #fff;
  border: 0;
  border-bottom: 1px solid var(--academy-line);
  display: grid;
  gap: 10px;
  grid-template-columns: minmax(0, 1fr) auto;
  min-height: 64px;
  padding: 10px 14px;
  text-align: left;
  width: 100%;
}

.academy-task-item:hover,
.academy-task-item.is-active {
  background: var(--academy-blue-soft);
}

.academy-task-item strong,
.academy-task-item small {
  display: block;
  overflow-wrap: anywhere;
}

.academy-task-item small {
  color: var(--academy-muted);
  font-size: 11px;
  margin-top: 3px;
}

.academy-task-form {
  min-width: 0;
  padding: 22px 28px 0;
}

.academy-task-form > .academy-editor-actions {
  border-top: 1px solid var(--academy-line);
  justify-content: flex-end;
  margin-top: 22px;
  padding-top: 18px;
}

.academy-answer-field {
  background: #fff8e8;
  border-left: 3px solid var(--academy-amber);
  padding: 10px;
}

.academy-scene-compose {
  background: var(--academy-soft);
  display: grid;
  gap: 10px;
  grid-template-columns: minmax(0, 1fr) 100px;
  margin-top: 14px;
  padding: 14px;
}

.academy-scene-compose label:first-child,
.academy-scene-compose label:last-of-type {
  grid-column: 1 / -1;
}

.academy-specialist-preview {
  background: #fff;
  min-height: 520px;
  padding: 28px;
}

.academy-preview-shell {
  margin: 0 auto;
  max-width: 860px;
}

.academy-preview-media {
  margin: 24px 0;
}

.academy-preview-media video,
.academy-preview-media iframe {
  aspect-ratio: 16 / 9;
  background: #08182b;
  border: 1px solid var(--academy-line);
  border-radius: 6px;
  display: block;
  height: auto;
  width: 100%;
}

.academy-preview-media iframe {
  min-height: 360px;
}

.academy-preview-media audio {
  width: 100%;
}

.academy-preview-media figcaption {
  align-items: center;
  color: var(--academy-muted);
  display: flex;
  font-size: 12px;
  gap: 8px;
  margin-top: 8px;
}

.academy-preview-media-empty {
  border: 1px dashed var(--academy-line-strong);
  margin: 24px 0;
  padding: 18px;
}

.academy-preview-media-empty p {
  color: var(--academy-muted);
  margin: 6px 0 0;
}

.academy-preview-copy {
  font-size: 16px;
  line-height: 1.7;
  overflow-wrap: anywhere;
}

.academy-preview-task {
  border-left: 4px solid var(--academy-orange);
  margin-top: 24px;
  padding: 4px 0 4px 18px;
}

.academy-preview-task strong,
.academy-preview-task p {
  overflow-wrap: anywhere;
}

.academy-json-workbench {
  border-top: 1px solid var(--academy-line);
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 20px;
  padding-top: 20px;
}

.academy-json-two-columns {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.academy-json-two-columns > :last-child {
  grid-column: 1 / -1;
}

.academy-authoring-section > .academy-editor-actions {
  border-top: 1px solid var(--academy-line);
  justify-content: flex-end;
  margin-top: 22px;
  padding-top: 18px;
}

.academy-media-layout {
  border-top: 1px solid var(--academy-line);
  display: grid;
  grid-template-columns: minmax(230px, .7fr) minmax(0, 2fr);
}

.academy-media-list {
  border-right: 1px solid var(--academy-line);
  max-height: 780px;
  min-width: 0;
  overflow: auto;
}

.academy-media-item {
  grid-template-columns: 32px minmax(0, 1fr) auto;
}

.academy-media-workspace {
  min-width: 0;
  padding: 22px 28px 0;
}

.academy-scene-editor {
  border-bottom: 1px solid var(--academy-line);
  border-top: 1px solid var(--academy-line);
  margin: 22px 0 0;
  padding: 18px 0;
}

.academy-factory-profile {
  background: color-mix(in srgb, var(--academy-blue-soft) 38%, var(--academy-surface));
  border: 1px solid color-mix(in srgb, var(--academy-blue) 22%, var(--academy-line));
  border-radius: 6px;
  margin-top: 22px;
  padding: 18px;
}

.academy-factory-badge {
  background: var(--academy-blue);
  border-radius: 4px;
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  padding: 6px 9px;
}

.academy-factory-rule {
  background: var(--academy-surface);
  border: 1px solid var(--academy-line);
  border-radius: 4px;
  min-width: 0;
  padding: 10px 12px;
}

.academy-factory-rule small,
.academy-factory-rule strong {
  display: block;
}

.academy-factory-rule small {
  color: var(--academy-muted);
  font-size: 10px;
  font-weight: 800;
  margin-bottom: 6px;
  text-transform: uppercase;
}

.academy-factory-rule strong {
  color: var(--academy-ink);
  font-size: 12px;
  overflow-wrap: anywhere;
}

.academy-factory-path {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  list-style: none;
  margin: 16px 0 0;
  padding: 0;
}

.academy-factory-path li {
  background: var(--academy-surface);
  border: 1px solid var(--academy-line);
  border-top: 3px solid #aab5c2;
  min-width: 0;
  padding: 11px 12px;
}

.academy-factory-path li.is-ready {
  border-top-color: var(--academy-success);
}

.academy-factory-path strong,
.academy-factory-path small {
  display: block;
  overflow-wrap: anywhere;
}

.academy-factory-path strong {
  color: var(--academy-ink);
  font-size: 12px;
}

.academy-factory-path small {
  color: var(--academy-muted);
  font-size: 11px;
  line-height: 1.45;
  margin-top: 5px;
}

.academy-subheading {
  align-items: center;
  display: flex;
  gap: 20px;
  justify-content: space-between;
  margin-bottom: 12px;
}

.academy-subheading strong,
.academy-subheading small {
  display: block;
}

.academy-scene-list {
  border-top: 1px solid #e5eaf0;
}

.academy-scene-row {
  align-items: start;
  border-bottom: 1px solid #e5eaf0;
  display: grid;
  gap: 12px;
  grid-template-columns: 30px minmax(0, 1fr) auto;
  padding: 16px 0;
}

.academy-scene-row > span {
  align-items: center;
  background: var(--academy-blue-soft);
  border-radius: 50%;
  color: var(--academy-blue);
  display: inline-flex;
  font-size: 11px;
  font-weight: 800;
  height: 28px;
  justify-content: center;
  width: 28px;
}

.academy-scene-row strong,
.academy-scene-row small {
  display: block;
  overflow-wrap: anywhere;
}

.academy-scene-fields {
  display: grid;
  gap: 10px;
  grid-template-columns: minmax(160px, 1.4fr) repeat(3, minmax(100px, .7fr));
  min-width: 0;
}

.academy-scene-fields label {
  color: var(--academy-muted);
  display: grid;
  font-size: 11px;
  font-weight: 700;
  gap: 5px;
}

.academy-scene-fields input,
.academy-scene-fields select,
.academy-scene-fields textarea {
  background: var(--academy-surface);
  border: 1px solid var(--academy-line);
  border-radius: 4px;
  color: var(--academy-text);
  font: inherit;
  min-width: 0;
  padding: 9px 10px;
  width: 100%;
}

.academy-scene-fields textarea {
  min-height: 92px;
  resize: vertical;
}

.academy-scene-fields label > small {
  color: var(--academy-muted);
  font-size: 10px;
  font-weight: 500;
  line-height: 1.4;
  margin: 0;
}

.academy-scene-fields .academy-field-wide,
.academy-scene-fields > small {
  grid-column: 1 / -1;
}

.academy-scene-actions {
  display: grid;
  gap: 6px;
}

.academy-scene-actions .academy-icon-button {
  height: 32px;
  min-width: 32px;
  padding: 0;
  width: 32px;
}

.academy-scene-actions .academy-icon-button-danger {
  color: var(--academy-danger);
}

@media (max-width: 1120px) {
  .academy-scene-fields {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .academy-factory-path {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .academy-scene-row {
    grid-template-columns: 28px minmax(0, 1fr);
  }

  .academy-scene-actions {
    grid-column: 2;
    grid-template-columns: repeat(3, 32px);
  }

  .academy-scene-fields {
    grid-template-columns: minmax(0, 1fr);
  }

  .academy-factory-path {
    grid-template-columns: minmax(0, 1fr);
  }
}

.academy-scene-row small {
  color: var(--academy-muted);
  font-size: 11px;
  margin-top: 3px;
}

.academy-guided-builder {
  background: #f8fbfd;
  border: 1px solid #dce7ee;
  border-radius: 16px;
  margin-top: 18px;
  padding: 18px;
}

.academy-guided-builder > .academy-subheading:not(:first-child) {
  border-top: 1px solid #dce7ee;
  margin-top: 20px;
  padding-top: 18px;
}

.academy-guided-builder > .academy-subheading small {
  color: var(--academy-muted);
  line-height: 1.45;
  margin-top: 3px;
}

.academy-guided-builder [data-guided-list] {
  display: grid;
  gap: 10px;
  margin-bottom: 12px;
}

.academy-guided-builder .academy-scene-row {
  background: #fff;
  border: 1px solid #dce7ee;
  border-radius: 13px;
  padding: 12px;
}

.academy-guided-builder .academy-scene-fields {
  grid-template-columns: minmax(0, 1.5fr) minmax(190px, .8fr);
}

.academy-guided-builder .academy-answer-field {
  align-content: center;
  background: #eef8f7;
  border: 1px solid #cce7e5;
  border-radius: 10px;
  color: #075d62;
  min-height: 44px;
  padding: 9px 10px;
}

.academy-guided-builder .academy-answer-field:has(input[type="checkbox"], input[type="radio"]) {
  align-items: center;
  display: flex;
  gap: 9px;
}

.academy-guided-builder .academy-answer-field input[type="checkbox"],
.academy-guided-builder .academy-answer-field input[type="radio"] {
  flex: 0 0 auto;
  height: 18px;
  margin: 0;
  width: 18px;
}

/* True/false puts its label directly in the row, unlike editable choices. */
.academy-editor .academy-guided-builder[data-presentation-type="true_false"] [data-guided-list] > .academy-scene-row {
  grid-template-columns: minmax(0, 1fr);
}

.academy-editor .academy-guided-builder[data-presentation-type="true_false"] .academy-scene-row > .academy-answer-field {
  align-items: center;
  box-sizing: border-box;
  cursor: pointer;
  display: flex;
  flex-direction: row;
  font-size: 15px;
  font-weight: 700;
  gap: 12px;
  line-height: 1.4;
  min-height: 48px;
  min-width: 0;
  width: 100%;
}

.academy-editor .academy-guided-builder[data-presentation-type="true_false"] .academy-answer-field input[type="radio"] {
  appearance: none;
  background: #fff;
  border: 2px solid #344a57;
  border-radius: 50%;
  flex: 0 0 20px;
  height: 20px;
  max-height: 20px;
  max-width: 20px;
  min-height: 20px;
  min-width: 20px;
  width: 20px;
}

.academy-editor .academy-guided-builder[data-presentation-type="true_false"] .academy-answer-field input[type="radio"]:checked {
  background: #fff radial-gradient(circle at center, #007c89 0 5px, transparent 5.5px) no-repeat;
  border-color: #007c89;
}

.academy-editor .academy-guided-builder[data-presentation-type="true_false"] .academy-answer-field:has(input:focus-visible) {
  outline: 3px solid #007c89;
  outline-offset: 2px;
}

@media (forced-colors: active) {
  .academy-editor .academy-guided-builder[data-presentation-type="true_false"] .academy-answer-field input[type="radio"] {
    appearance: auto;
    background: none;
    border: 0;
    accent-color: Highlight;
  }
}

.academy-guided-builder [data-criteria-total] {
  background: #e1f4f3;
  border-radius: 999px;
  color: #075d62;
  font-size: 13px;
  font-weight: 850;
  padding: 7px 11px;
}

.academy-guided-builder[data-builder-valid="false"] [data-criteria-total] {
  background: var(--academy-red-soft);
  color: var(--academy-red);
}

.academy-guided-builder > .academy-button-secondary {
  justify-self: start;
}

@media (max-width: 900px) {
  .academy-guided-builder .academy-scene-fields {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 620px) {
  .academy-guided-builder {
    border-left: 0;
    border-radius: 0;
    border-right: 0;
    margin-left: -18px;
    margin-right: -18px;
    padding: 16px 18px;
  }

  .academy-guided-builder .academy-scene-row {
    grid-template-columns: 26px minmax(0, 1fr);
  }

  .academy-guided-builder .academy-scene-actions {
    grid-column: 2;
  }

  .academy-guided-builder > .academy-button-secondary {
    width: 100%;
  }
}

.academy-media-workspace > .academy-json-workbench,
.academy-media-workspace > .academy-editor-actions {
  margin-left: 0;
  margin-right: 0;
}

.academy-empty-inline,
.academy-empty-state {
  color: var(--academy-muted);
  padding: 22px 16px;
  text-align: center;
}

.academy-empty-inline strong,
.academy-empty-state strong {
  color: var(--academy-ink);
  display: block;
  margin-bottom: 5px;
}

.academy-empty-state .academy-button-primary {
  margin-top: 14px;
}

.academy-editor-message {
  align-items: center;
  background: var(--academy-red-soft);
  border-bottom: 1px solid #e6b9b9;
  border-top: 1px solid #e6b9b9;
  color: #712626;
  display: flex;
  gap: 20px;
  justify-content: space-between;
  padding: 14px 28px;
}

.academy-editor-message.is-conflict {
  background: var(--academy-amber-soft);
  border-color: #ecd19d;
  color: #744709;
}

.academy-editor-message p {
  line-height: 1.45;
  margin: 4px 0 0;
}

.academy-editor-loading {
  align-items: center;
  background: rgba(255, 255, 255, .94);
  display: flex;
  gap: 12px;
  inset: 0;
  justify-content: center;
  min-height: 64px;
  position: sticky;
  top: 0;
  z-index: 5;
}

.academy-editor-loading span {
  animation: academy-editor-spin .8s linear infinite;
  border: 3px solid #cbd5e1;
  border-radius: 50%;
  border-top-color: var(--academy-blue);
  height: 24px;
  width: 24px;
}

.academy-editor-loading p {
  color: var(--academy-muted);
  margin: 0;
}

.academy-revision-list {
  list-style: none;
  margin: 0 28px;
  padding: 0;
}

.academy-revision-list li {
  align-items: center;
  border-bottom: 1px solid var(--academy-line);
  display: grid;
  gap: 12px;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  padding: 13px 0;
}

.academy-revision-list li > span {
  color: var(--academy-blue);
  font-weight: 800;
}

.academy-revision-list strong,
.academy-revision-list small {
  display: block;
  overflow-wrap: anywhere;
}

.academy-revision-list small {
  color: var(--academy-muted);
  font-size: 11px;
  margin-top: 3px;
}

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

html:has(.academy-editor-dialog-backdrop) {
  overflow: hidden;
  scrollbar-gutter: auto;
}

.academy-editor-dialog-backdrop {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100dvh;
  box-sizing: border-box;
  z-index: 1200;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgb(15 35 58 / 58%);
  backdrop-filter: blur(6px);
}

.academy-editor-dialog {
  width: min(820px, 100%);
  max-height: min(860px, calc(100vh - 48px));
  overflow: auto;
  border: 1px solid #cddced;
  border-radius: 20px;
  background: #fff;
  box-shadow: 0 24px 70px rgb(17 45 78 / 28%);
}

.academy-editor-dialog > header {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding: 24px 26px 18px;
  border-bottom: 1px solid #dce6f1;
  border-radius: 20px 20px 0 0;
  background: #f4f9ff;
}

.academy-editor-dialog > header h2,
.academy-editor-dialog > header p {
  margin: 0;
}

.academy-editor-dialog > header p {
  margin-top: 6px;
  color: #58708d;
}

.academy-editor-dialog form {
  padding: 24px 26px 26px;
}

.academy-editor-dialog .academy-editor-actions {
  margin-top: 22px;
}

.academy-searchable-select {
  display: block;
  position: relative;
  width: 100%;
}

.academy-searchable-native {
  border: 0 !important;
  clip: rect(0 0 0 0) !important;
  clip-path: inset(50%) !important;
  height: 1px !important;
  margin: -1px !important;
  overflow: hidden !important;
  padding: 0 !important;
  position: absolute !important;
  white-space: nowrap !important;
  width: 1px !important;
}

.academy-searchable-input[aria-expanded="true"] {
  border-color: var(--academy-blue);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--academy-blue) 20%, transparent);
}

.academy-searchable-listbox {
  background: #fff;
  border: 1px solid #9eb7d1;
  border-radius: 8px;
  box-shadow: 0 14px 38px rgb(17 45 78 / 22%);
  left: 0;
  margin-top: 6px;
  max-height: min(320px, 45vh);
  overflow: auto;
  padding: 6px;
  position: absolute;
  right: 0;
  top: 100%;
  z-index: 25;
}

.academy-searchable-listbox[hidden] {
  display: none;
}

.academy-searchable-option {
  border-radius: 6px;
  color: var(--academy-ink);
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.35;
  overflow-wrap: anywhere;
  padding: 10px 12px;
}

.academy-searchable-option.is-active,
.academy-searchable-option:hover {
  background: var(--academy-blue-soft);
  color: var(--academy-blue);
}

.academy-searchable-option[aria-selected="true"] {
  box-shadow: inset 3px 0 var(--academy-blue);
}

.academy-searchable-option:has(.academy-option-check) {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  box-sizing: border-box;
}
.academy-option-check {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 18px;
  width: 18px;
  height: 18px;
  border: 1px solid currentColor;
  border-radius: 4px;
}
.academy-help-field { min-width: 0; position: relative; }
.academy-help-label { display: flex; align-items: center; min-height: 44px; padding-right: 44px; }
.academy-field-help { margin-top: 2px; }
.academy-field-help > summary {
  align-items: center;
  display: inline-flex;
  justify-content: center;
  cursor: pointer;
  color: var(--academy-blue);
  border-radius: 8px;
  min-width: 44px;
  min-height: 44px;
  font-size: 20px;
  list-style: none;
}
.academy-help-field > .academy-field-help > summary { position: absolute; top: 0; right: 0; }
.academy-field-help > summary::-webkit-details-marker { display: none; }
.academy-field-help > summary:focus-visible { outline: 2px solid var(--academy-blue); outline-offset: 2px; }
.academy-field-help > p {
  margin: 0 0 8px;
  padding: 10px 12px;
  border-radius: 8px;
  background: var(--academy-blue-soft);
  font-size: 13px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.academy-searchable-option[aria-disabled="true"] {
  cursor: not-allowed;
  opacity: .5;
}

.academy-searchable-empty {
  color: var(--academy-muted);
  font-size: 12px;
  margin: 0;
  padding: 14px 12px;
}

.academy-searchable-status {
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  height: 1px;
  overflow: hidden;
  position: absolute;
  white-space: nowrap;
  width: 1px;
}

.academy-role-picker {
  background: #f8fbfd;
  border: 1px solid #cddced;
  border-radius: 14px;
  display: grid;
  gap: 10px;
  margin: 0;
  min-width: 0;
  padding: 16px;
}

.academy-role-picker > legend {
  color: var(--academy-ink);
  font-size: 13px;
  font-weight: 800;
  padding: 0 6px;
}

.academy-role-picker > p {
  color: var(--academy-muted);
  font-size: 12px;
  line-height: 1.45;
  margin: 0;
}

.academy-role-picker-search {
  align-items: center;
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  position: relative;
}

.academy-role-picker-search > svg {
  color: #60748d;
  grid-column: 1;
  grid-row: 1;
  height: 16px;
  margin-left: 13px;
  pointer-events: none;
  width: 16px;
  z-index: 1;
}

.academy-role-picker-search > input {
  grid-column: 1 / -1;
  grid-row: 1;
  padding-left: 40px;
}

.academy-role-picker-summary {
  color: var(--academy-muted);
  display: flex;
  flex-wrap: wrap;
  font-size: 12px;
  gap: 6px 16px;
  justify-content: space-between;
}

.academy-role-picker-summary [data-academy-role-selected] {
  color: #087b80;
  font-weight: 800;
}

.academy-editor .academy-role-options {
  background: #fff;
  border: 1px solid #dbe5ee;
  border-radius: 12px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
  gap: 2px;
  max-height: 240px;
  overflow: auto;
  padding: 6px;
}

.academy-role-options:empty::before {
  color: var(--academy-muted);
  content: "Los perfiles aparecerán aquí cuando Odoo responda.";
  font-size: 12px;
  padding: 12px;
  text-align: center;
}

.academy-editor .academy-role-options > .academy-role-option {
  align-items: center;
  flex-direction: row;
  border-radius: 9px;
  color: var(--academy-ink);
  cursor: pointer;
  display: grid;
  min-height: 44px;
  min-width: 0;
  box-sizing: border-box;
  font-size: 12px;
  font-weight: 700;
  gap: 10px;
  grid-template-columns: 18px minmax(0, 1fr);
  line-height: 1.35;
  padding: 8px 6px;
}

.academy-role-option:hover,
.academy-role-option:focus-within {
  background: var(--academy-blue-soft);
}

.academy-editor .academy-role-option input[type="checkbox"] {
  appearance: auto;
  height: 18px;
  min-height: 0;
  max-height: 18px;
  margin: 0;
  padding: 0;
  width: 18px;
  min-width: 18px;
  max-width: 18px;
}

.academy-role-option span {
  overflow-wrap: anywhere;
}

.academy-editor .academy-role-options > .academy-role-option[hidden] {
  display: none;
}

@media (max-width: 640px) {
  .academy-editor .academy-role-options { grid-template-columns: minmax(0, 1fr); }
}

.academy-field-error {
  color: #a52727;
  display: block;
  font-size: 12px;
  font-weight: 750;
  line-height: 1.4;
  margin-top: 1px;
}

.academy-field-grid label.has-error input,
.academy-field-grid label.has-error select,
.academy-field-grid label.has-error textarea,
.academy-editor [aria-invalid="true"] {
  border-color: #b62e3a;
  box-shadow: 0 0 0 3px rgb(182 46 58 / 13%);
}

.academy-editor-message-issues {
  display: grid;
  gap: 4px;
  margin: 10px 0 0;
  padding-left: 18px;
}

.academy-editor-dialog:focus {
  outline: none;
}

.academy-editor-dialog :focus-visible,
.academy-searchable-select :focus-visible {
  outline: 3px solid color-mix(in srgb, var(--academy-blue) 55%, #fff);
  outline-offset: 2px;
}

@media (max-width: 720px) {
  .academy-editor-dialog-backdrop {
    padding: 10px;
  }

  .academy-editor-dialog {
    max-height: calc(100vh - 20px);
  }

  .academy-editor-dialog > header,
  .academy-editor-dialog form {
    padding: 18px;
  }
}

.academy-video-production {
  border-bottom: 1px solid var(--academy-line);
  padding: 22px 28px 26px;
}

.academy-video-production > header {
  align-items: flex-start;
  display: flex;
  gap: 18px;
  justify-content: space-between;
}

.academy-video-production h4,
.academy-video-production p {
  margin: 0;
}

.academy-video-production h4 {
  color: var(--academy-ink);
  font-size: 18px;
  margin-top: 4px;
}

.academy-video-production header p {
  color: var(--academy-muted);
  margin-top: 5px;
}

.academy-production-status {
  background: #eef2f7;
  border: 1px solid #d4dce7;
  color: #46566c;
  font-size: 11px;
  font-weight: 800;
  padding: 6px 9px;
  text-transform: uppercase;
}

.academy-production-status.is-succeeded {
  background: #e8f6ef;
  border-color: #b8dfca;
  color: #17643d;
}

.academy-production-status.is-failed,
.academy-production-status.is-rejected {
  background: #fceaea;
  border-color: #e7bcbc;
  color: #8a2c2c;
}

.academy-production-stages {
  display: grid;
  gap: 0;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  list-style: none;
  margin: 20px 0;
  padding: 0;
}

.academy-production-stage {
  align-items: center;
  border-bottom: 3px solid #cfd8e5;
  display: grid;
  gap: 9px;
  grid-template-columns: 14px minmax(0, 1fr);
  min-height: 66px;
  padding: 0 12px 12px 0;
  position: relative;
}

.academy-production-stage > span {
  background: #cfd8e5;
  border: 3px solid #fff;
  border-radius: 50%;
  box-shadow: 0 0 0 1px #cfd8e5;
  height: 12px;
  width: 12px;
}

.academy-production-stage strong,
.academy-production-stage small,
.academy-production-stage b {
  display: block;
}

.academy-production-stage small {
  color: var(--academy-muted);
  font-size: 11px;
  margin-top: 3px;
}

.academy-production-stage b {
  color: #66758a;
  font-size: 10px;
  grid-column: 2;
  text-transform: uppercase;
}

.academy-production-stage.is-ready {
  border-color: #26835a;
}

.academy-production-stage.is-ready > span {
  background: #26835a;
  box-shadow: 0 0 0 1px #26835a;
}

.academy-production-stage.is-ready b {
  color: #17643d;
}

.academy-production-summary {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.academy-production-summary label,
.academy-production-summary > div,
.academy-video-production .academy-field-grid label {
  color: var(--academy-muted);
  display: grid;
  font-size: 11px;
  font-weight: 700;
  gap: 6px;
}

.academy-production-summary > div {
  background: #f7f9fc;
  border: 1px solid var(--academy-line);
  min-height: 66px;
  padding: 10px 12px;
}

.academy-production-summary > div small,
.academy-production-summary > div strong { display: block; }
.academy-production-summary > div strong { color: var(--academy-ink); font-size: 13px; margin-top: 6px; }

.academy-production-evidence {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin: 14px 0 0;
}

.academy-production-evidence > div {
  background: #f7f9fc;
  border: 1px solid var(--academy-line);
  min-width: 0;
  padding: 10px;
}

.academy-production-evidence dt { color: var(--academy-muted); font-size: 10px; font-weight: 800; text-transform: uppercase; }
.academy-production-evidence dd { color: var(--academy-ink); font-family: ui-monospace, monospace; font-size: 11px; margin: 6px 0 0; overflow-wrap: anywhere; }

.academy-production-summary input,
.academy-production-summary select {
  background: #fff;
  border: 1px solid var(--academy-line);
  border-radius: 4px;
  color: var(--academy-ink);
  min-height: 40px;
  padding: 8px 10px;
  width: 100%;
}

.academy-video-production form > label {
  display: grid;
  gap: 6px;
}

.academy-video-production form > label select {
  min-height: 40px;
  min-width: 0;
  width: 100%;
}

.academy-production-blockers {
  background: #fff8e8;
  border-left: 3px solid #d08b19;
  margin: 18px 0;
  padding: 13px 16px;
}

.academy-production-blockers ul {
  color: #6b4a16;
  display: grid;
  gap: 5px;
  margin: 9px 0 0;
  padding-left: 19px;
}

.academy-video-production .academy-advanced {
  border: 1px solid var(--academy-line);
  margin: 16px 0;
  padding: 12px 14px;
}

.academy-video-production .academy-advanced .academy-field-grid {
  margin-top: 14px;
}

.academy-video-production .academy-editor-actions {
  align-items: center;
  justify-content: space-between;
  margin: 14px 0 0;
}

.academy-video-production .academy-editor-actions span {
  color: var(--academy-muted);
  font-size: 12px;
}

.academy-production-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.academy-production-approvals {
  border: 1px solid var(--academy-line);
  margin: 18px 0;
}

.academy-production-approvals > header {
  background: #f5f8fc;
  padding: 14px 16px;
}

.academy-production-approvals > header strong,
.academy-production-approvals > header small {
  display: block;
}

.academy-production-approvals > header small {
  color: var(--academy-muted);
  margin-top: 4px;
}

.academy-approval-step {
  border-top: 1px solid var(--academy-line);
}

.academy-approval-step summary {
  align-items: center;
  cursor: pointer;
  display: grid;
  gap: 10px;
  grid-template-columns: 12px minmax(0, 1fr) auto;
  padding: 13px 16px;
}

.academy-approval-step summary > span {
  background: #c9d3df;
  border-radius: 50%;
  height: 10px;
  width: 10px;
}

.academy-approval-step.is-approved summary > span { background: #26835a; }
.academy-approval-step.is-rejected summary > span { background: #b33a3a; }
.academy-approval-step summary strong,
.academy-approval-step summary small { display: block; }
.academy-approval-step summary small { color: var(--academy-muted); margin-top: 3px; }
.academy-approval-step summary b { color: #596a7f; font-size: 10px; text-transform: uppercase; }
.academy-approval-step.is-approved summary b { color: #17643d; }
.academy-approval-step.is-rejected summary b { color: #8a2c2c; }

.academy-approval-step form {
  background: #fbfcfe;
  border-top: 1px solid var(--academy-line);
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(150px, .5fr) minmax(240px, 1.5fr);
  padding: 16px;
}

.academy-approval-step form label {
  color: var(--academy-muted);
  display: grid;
  font-size: 11px;
  font-weight: 700;
  gap: 6px;
}

.academy-approval-step form label:nth-of-type(3) { grid-column: 1 / -1; }
.academy-approval-step form input,
.academy-approval-step form select,
.academy-approval-step form textarea {
  background: #fff;
  border: 1px solid var(--academy-line);
  border-radius: 4px;
  color: var(--academy-ink);
  min-height: 40px;
  padding: 8px 10px;
  width: 100%;
}
.academy-approval-step form textarea { min-height: 78px; resize: vertical; }
.academy-approval-step form button { justify-self: end; }
.academy-approval-decision,
.academy-approval-waiting { background: #fbfcfe; border-top: 1px solid var(--academy-line); margin: 0; padding: 13px 38px; }
.academy-approval-decision p { margin: 0 0 4px; }
.academy-approval-decision small,
.academy-approval-waiting { color: var(--academy-muted); }

.academy-private-video-dialog {
  width: min(920px, calc(100vw - 32px));
  max-height: calc(100vh - 32px);
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 20px 60px rgb(0 0 0 / 28%);
}

.academy-private-video-dialog::backdrop {
  background: rgb(8 20 36 / 72%);
}

.academy-private-video-dialog > header,
.academy-private-video-dialog > footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 18px;
}

.academy-private-video-dialog h3 {
  margin: 2px 0 0;
  font-size: 18px;
}

.academy-private-video-dialog video,
.academy-private-video-dialog img {
  display: block;
  width: 100%;
  max-height: calc(100vh - 190px);
  aspect-ratio: 16 / 9;
  background: #05080d;
  object-fit: contain;
}

.academy-private-video-dialog audio {
  display: block;
  margin: 24px auto;
  width: min(720px, calc(100% - 36px));
}

.academy-private-video-dialog > footer {
  color: var(--muted);
  font-size: 12px;
}

@media (max-width: 980px) {
  .academy-editor-context {
    grid-template-columns: 1fr;
  }

  .academy-editor-context > details,
  .academy-independent-list {
    border-bottom: 1px solid var(--academy-line);
    border-right: 0;
  }

  .academy-context-list,
  .academy-independent-list > div {
    max-height: 230px;
  }

  .academy-field-grid,
  .academy-json-workbench,
  .academy-json-two-columns,
  .academy-media-layout,
  .academy-production-summary,
  .academy-task-layout {
    grid-template-columns: 1fr;
  }

  .academy-json-two-columns > :last-child {
    grid-column: auto;
  }

  .academy-media-list {
    border-bottom: 1px solid var(--academy-line);
    border-right: 0;
    max-height: 240px;
  }

  .academy-task-list {
    border-bottom: 1px solid var(--academy-line);
    border-right: 0;
    max-height: 240px;
  }

  .academy-trace-panel {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .academy-trace-panel > div:nth-child(2) {
    border-right: 0;
  }

  .academy-trace-panel > div:nth-child(-n + 2) {
    border-bottom: 1px solid var(--academy-line);
  }
}

@media (max-width: 620px) {
  .academy-editor-heading,
  .academy-editor-titlebar,
  .academy-editor-section-heading,
  .academy-subheading,
  .academy-editor-message {
    align-items: stretch;
    flex-direction: column;
  }

  .academy-editor-heading,
  .academy-editor-titlebar,
  .academy-editor-section-heading {
    padding-left: 18px;
    padding-right: 18px;
  }

  .academy-editor-path {
    padding-left: 18px;
    padding-right: 18px;
  }

  .academy-micro-form,
  .academy-media-workspace,
  .academy-task-form,
  .academy-specialist-preview {
    padding-left: 18px;
    padding-right: 18px;
  }

  .academy-authoring-section > .academy-field-grid,
  .academy-authoring-section > .academy-json-workbench,
  .academy-authoring-section > .academy-editor-actions,
  .academy-revision-list {
    margin-left: 18px;
    margin-right: 18px;
  }

  .academy-trace-panel {
    grid-template-columns: 1fr;
    margin-left: -18px;
    margin-right: -18px;
  }

  .academy-trace-panel > div {
    border-bottom: 1px solid var(--academy-line);
    border-right: 0;
  }

  .academy-trace-panel > div:last-child {
    border-bottom: 0;
  }

  .academy-editor-tabs {
    padding: 0 10px;
  }

  .academy-video-production {
    padding-left: 18px;
    padding-right: 18px;
  }

  .academy-production-stages {
    grid-template-columns: 1fr;
  }

  .academy-production-stage {
    border-bottom: 0;
    border-left: 3px solid #cfd8e5;
    padding: 8px 0 8px 14px;
  }

  .academy-production-stage.is-ready {
    border-left-color: #26835a;
  }

  .academy-approval-step summary {
    grid-template-columns: 12px minmax(0, 1fr);
  }

  .academy-approval-step summary b {
    grid-column: 2;
    justify-self: start;
  }

  .academy-approval-step form {
    grid-template-columns: minmax(0, 1fr);
  }

  .academy-approval-step form label:nth-of-type(3) {
    grid-column: auto;
  }

  .academy-approval-step form button {
    justify-self: stretch;
    width: 100%;
  }

  .academy-approval-decision,
  .academy-approval-waiting {
    padding-left: 16px;
    padding-right: 16px;
  }

  .academy-editor-actions > button,
  .academy-editor-heading-actions > button {
    flex: 1 1 150px;
  }

  .academy-micro-item,
  .academy-media-item,
  .academy-task-item {
    grid-template-columns: 30px minmax(0, 1fr);
  }

  .academy-micro-item .academy-status,
  .academy-media-item .academy-status {
    grid-column: 2;
    justify-self: start;
  }

  .academy-task-item .academy-status {
    grid-column: 2;
    justify-self: start;
  }

  .academy-scene-compose {
    grid-template-columns: 1fr;
  }

  .academy-scene-compose label:first-child,
  .academy-scene-compose label:last-of-type {
    grid-column: auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  .academy-editor-loading span {
    animation: none;
  }
}

/* Flujo didactico del Estudio de contenido: cada nivel tiene su espacio y
   conserva la relacion curso -> leccion -> microleccion. */
.academy-editor {
  background: transparent;
  display: grid;
  gap: 18px;
}

.academy-editor-heading {
  background: #f4fafb;
  border: 1px solid #d6e5eb;
  border-radius: 20px;
  padding: 24px;
}

.academy-editor-heading-actions {
  justify-content: flex-end;
  max-width: 560px;
}

.academy-editor-heading-actions .academy-button-primary,
.academy-editor-heading-actions .academy-button-secondary {
  border-radius: 14px;
}

.academy-editor-path {
  background: transparent;
  border: 0;
  gap: 12px;
  padding: 0 8px;
}

.academy-editor-path span,
.academy-editor-path strong {
  align-items: center;
  background: #fff;
  border: 1px solid #d8e4ec;
  border-radius: 999px;
  display: inline-flex;
  min-height: 36px;
  padding: 0 15px;
}

.academy-editor-context {
  border: 0;
  gap: 16px;
  grid-template-columns: minmax(210px, .8fr) minmax(240px, 1fr) minmax(340px, 1.35fr);
  min-height: 300px;
}

.academy-editor-context > details,
.academy-independent-list {
  background: #fff;
  border: 1px solid #d8e4ec;
  border-radius: 20px;
  box-shadow: 0 10px 28px rgba(23, 35, 59, .06);
  overflow: hidden;
}

.academy-editor-context > details,
.academy-independent-list,
.academy-editor-context > :last-child {
  border-right: 1px solid #d8e4ec;
}

.academy-editor-context summary,
.academy-independent-list > header {
  background: #f8fbfd;
  border-bottom: 1px solid #dfe8ef;
  min-height: 70px;
  padding: 14px 16px;
}

.academy-editor-context summary > span,
.academy-independent-list > header > div > span {
  background: #dff4f3;
  border-radius: 11px;
  color: #087b80;
  height: 34px;
  width: 34px;
}

.academy-context-list,
.academy-independent-list > div {
  max-height: 380px;
}

.academy-context-item,
.academy-micro-item {
  border-bottom-color: #e9eff4;
  padding: 14px 16px;
}

.academy-context-item.is-active,
.academy-micro-item.is-active {
  background: #e9f7f7;
  box-shadow: inset 4px 0 #07858a;
}

.academy-context-symbol {
  background: #e5f2ff;
  border-radius: 10px;
  color: #15558f;
}

.academy-context-symbol svg {
  height: 17px;
  width: 17px;
}

.academy-catalog-search {
  background: #fbfdff;
  padding: 12px 14px;
}

.academy-catalog-search input,
.academy-catalog-search button {
  border-radius: 12px;
}

.academy-editor-main {
  background: #fff;
  border: 1px solid #d8e4ec;
  border-radius: 20px;
  box-shadow: 0 12px 32px rgba(23, 35, 59, .06);
  overflow: hidden;
}

.content-studio-shell {
  display: grid;
  gap: 18px;
  min-width: 0;
  width: 100%;
}

.content-studio-gaps {
  background: #fff;
  border: 1px solid #d8e4ec;
  border-radius: 20px;
  box-shadow: 0 10px 28px rgba(23, 35, 59, .06);
  overflow: hidden;
}

.content-studio-gaps > summary {
  align-items: center;
  cursor: pointer;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  justify-content: space-between;
  list-style: none;
  padding: 18px 22px;
}

.content-studio-gaps > summary::-webkit-details-marker { display: none; }
.content-studio-gaps > summary span { font-size: 16px; font-weight: 800; }
.content-studio-gaps > summary small { color: var(--academy-muted); }
.content-studio-gaps[open] > summary { border-bottom: 1px solid #e3ebf0; }
.content-studio-gaps #studioGapsBoard { padding: 16px; }
.content-studio-gaps .aiu-card { box-shadow: none; }

.academy-editor-commandbar {
  align-items: center;
  background: #fff;
  border: 1px solid #d8e4ec;
  border-radius: 20px;
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  justify-content: space-between;
  padding: 12px;
}

.academy-context-tabs {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.academy-context-tabs button {
  align-items: center;
  background: #f5f8fb;
  border: 1px solid #d8e4ec;
  border-radius: 14px;
  color: #506078;
  display: inline-flex;
  gap: 9px;
  min-height: 44px;
  padding: 0 14px;
}

.academy-context-tabs button.is-active {
  background: #e4f6f5;
  border-color: #07858a;
  color: #075f64;
}

.academy-context-tabs svg,
.academy-editor-heading-actions svg,
.academy-editor-heading > button svg {
  height: 17px;
  width: 17px;
}

.academy-context-tabs strong {
  align-items: center;
  background: #fff;
  border-radius: 999px;
  display: inline-flex;
  font-size: 11px;
  height: 24px;
  justify-content: center;
  min-width: 24px;
  padding: 0 7px;
}

.academy-editor-commandbar .academy-editor-heading-actions {
  max-width: none;
}

.academy-editor-commandbar .academy-editor-heading-actions button,
.academy-editor-heading > button {
  align-items: center;
  display: inline-flex;
  gap: 8px;
}

.academy-editor-catalog {
  background: #fff;
  border: 1px solid #d8e4ec;
  border-radius: 20px;
  box-shadow: 0 10px 28px rgba(23, 35, 59, .06);
  overflow: hidden;
}

.academy-editor-catalog > header {
  align-items: center;
  background: #f8fbfd;
  border-bottom: 1px solid #dfe8ef;
  display: flex;
  gap: 18px;
  justify-content: space-between;
  padding: 18px 22px;
}

.academy-editor-catalog > header h3 { margin: 3px 0 2px; }
.academy-editor-catalog > header p { color: var(--academy-muted); margin: 0; }

.academy-editor-catalog .academy-context-list,
.academy-editor-catalog .academy-micro-catalog {
  max-height: 520px;
  overflow: auto;
}

.academy-editor-heading-with-back {
  align-items: flex-start;
  display: flex;
  gap: 14px;
  min-width: 0;
}

.academy-editor-heading-with-back .academy-icon-button {
  border-radius: 14px;
  flex: 0 0 42px;
  height: 42px;
  padding: 0;
  width: 42px;
}

.academy-resource-status {
  align-items: center;
  background: #fff9e8;
  border: 1px solid #efd492;
  border-radius: 16px;
  color: #684b0c;
  display: grid;
  gap: 14px;
  grid-template-columns: 28px minmax(0, 1fr) auto;
  padding: 14px 16px;
}

.academy-resource-status > svg {
  height: 22px;
  width: 22px;
}

.academy-resource-status strong,
.academy-resource-status p,
.academy-resource-status small {
  display: block;
}

.academy-resource-status p {
  line-height: 1.45;
  margin: 3px 0 0;
}

.academy-resource-status small {
  color: #80672f;
  margin-top: 5px;
}

.academy-resource-status.is-loading {
  background: #eef7fb;
  border-color: #bedbe8;
  color: #174f69;
}

.academy-resource-status.is-loading > svg {
  animation: academy-editor-spin .8s linear infinite;
}

.academy-course-overview {
  background: #fff;
  border: 1px solid #d8e4ec;
  border-radius: 20px;
  box-shadow: 0 12px 32px rgba(23, 35, 59, .06);
  overflow: hidden;
}

.academy-course-overview > header {
  align-items: center;
  background: #f8fbfd;
  border-bottom: 1px solid #dfe8ef;
  display: flex;
  justify-content: space-between;
  padding: 20px 24px;
}

.academy-course-overview > header h3 {
  font-size: 20px;
  margin: 4px 0;
}

.academy-course-overview > header p {
  color: var(--academy-muted);
  margin: 0;
}

.academy-course-overview > header .academy-button-secondary {
  border-radius: 14px;
  gap: 8px;
}

.academy-course-overview > header .academy-button-secondary svg {
  height: 16px;
  width: 16px;
}

.academy-independent-entry {
  align-items: center;
  background: #eff8fb;
  border-bottom: 1px solid #d9e9f0;
  display: flex;
  gap: 16px;
  justify-content: space-between;
  padding: 16px 24px;
}

.academy-independent-entry > div { min-width: 0; }
.academy-independent-entry h4 { font-size: 17px; margin: 3px 0 5px; }
.academy-independent-entry p { color: var(--academy-muted); line-height: 1.5; margin: 0; }
.academy-independent-entry button { flex: 0 0 auto; min-height: 44px; white-space: normal; }

.academy-course-filter {
  align-items: end;
  background: #fff;
  border-bottom: 1px solid #e2eaf0;
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(260px, 1fr) auto auto;
  padding: 14px 18px;
}

.academy-course-filter label {
  align-items: center;
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  min-width: 0;
  position: relative;
}

.academy-course-filter label > span {
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  height: 1px;
  overflow: hidden;
  position: absolute;
  white-space: nowrap;
  width: 1px;
}

.academy-course-filter label > svg {
  color: #60748d;
  grid-column: 1;
  grid-row: 1;
  height: 16px;
  margin-left: 13px;
  pointer-events: none;
  width: 16px;
  z-index: 1;
}

.academy-course-filter input {
  background: #f8fbfd;
  border: 1px solid #cbd9e5;
  border-radius: 13px;
  color: var(--academy-ink);
  font: inherit;
  grid-column: 1 / -1;
  grid-row: 1;
  min-height: 44px;
  padding: 10px 13px 10px 40px;
  width: 100%;
}

.academy-course-filter output {
  color: var(--academy-muted);
  font-size: 12px;
  white-space: nowrap;
}

.academy-course-filter .academy-button-secondary {
  min-height: 42px;
}

.academy-course-filter-empty {
  min-height: 310px;
}

.academy-course-overview-list {
  display: grid;
  gap: 12px;
  padding: 18px;
}

.academy-course-overview-card {
  align-items: start;
  background: #fff;
  border: 1px solid #dce6ed;
  border-radius: 20px;
  display: grid;
  gap: 12px 16px;
  grid-template-columns: 48px minmax(0, 1fr);
  padding: 16px;
  transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}

.academy-course-overview-card:hover {
  border-color: #8fc9cc;
  box-shadow: 0 12px 26px rgba(23, 35, 59, .08);
  transform: translateY(-1px);
}

.academy-course-overview-icon {
  align-items: center;
  background: #e1f4f3;
  border-radius: 14px;
  color: #087b80;
  display: flex;
  justify-content: center;
  height: 48px;
  width: 48px;
}

.academy-course-overview-card:nth-child(3n + 2) .academy-course-overview-icon {
  background: #fff0e5;
  color: #c65a14;
}

.academy-course-overview-card:nth-child(3n) .academy-course-overview-icon {
  background: #edf0ff;
  color: #4659a8;
}

.academy-course-overview-icon svg {
  height: 24px;
  width: 24px;
}

.academy-course-overview-copy {
  min-width: 0;
}

.academy-course-overview-heading {
  align-items: start;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
  justify-content: space-between;
}

.academy-course-overview-heading > div { min-width: 0; }
.academy-course-overview-heading > .academy-status { flex: 0 0 auto; }

.academy-course-overview-copy h3 {
  font-size: 17px;
  margin: 3px 0 5px;
  overflow-wrap: anywhere;
}

.academy-course-overview-copy > p {
  color: var(--academy-muted);
  line-height: 1.45;
  margin: 0 0 12px;
  max-width: 760px;
}

.academy-course-overview-meta {
  align-items: center;
  color: #536278;
  display: flex;
  flex-wrap: wrap;
  font-size: 12px;
  gap: 8px 18px;
}

.academy-course-overview-meta span {
  align-items: center;
  display: inline-flex;
  gap: 6px;
}

.academy-course-overview-meta svg {
  height: 15px;
  width: 15px;
}

.academy-course-overview-progress {
  background: #e9eff3;
  border-radius: 999px;
  height: 6px;
  margin-top: 13px;
  overflow: hidden;
}

.academy-course-overview-progress span {
  background: #07858a;
  border-radius: inherit;
  display: block;
  height: 100%;
}

.academy-course-overview-actions {
  align-items: center;
  border-top: 1px solid var(--academy-line);
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  grid-column: 1 / -1;
  justify-content: space-between;
  min-width: 0;
  padding-top: 12px;
}

.academy-course-actions-primary,
.academy-course-actions-secondary {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.academy-course-actions-secondary {
  border-left: 1px solid var(--academy-line);
  padding-left: 16px;
}

.academy-course-overview-actions button {
  align-items: center;
  display: inline-flex;
  gap: 8px;
  justify-content: center;
  min-height: 38px;
  padding: 8px 12px;
}

.academy-course-overview-actions .academy-button-secondary {
  border-radius: 10px;
  white-space: nowrap;
}

.academy-course-overview-actions svg {
  flex: none;
  height: 16px;
  width: 16px;
}

.academy-course-overview-empty {
  align-items: center;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 58px 24px;
  text-align: center;
}

.academy-course-overview-empty > svg {
  color: #07858a;
  height: 34px;
  width: 34px;
}

.academy-course-overview-empty p {
  color: var(--academy-muted);
  margin: 0 0 8px;
}

.academy-status-info {
  background: #e7f1fa;
  color: #15558f;
}

.academy-course-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  padding: 18px;
}

.academy-course-grid .academy-context-item,
.academy-lesson-list .academy-context-item,
.academy-micro-catalog .academy-micro-item {
  border: 1px solid #dfe8ef;
  border-radius: 16px;
  min-height: 76px;
}

.academy-lesson-list {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  padding: 18px;
}

.academy-micro-catalog {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  padding: 18px;
}

.academy-micro-catalog .academy-catalog-search,
.academy-micro-catalog .academy-empty-state,
.academy-micro-catalog .academy-load-more {
  grid-column: 1 / -1;
}

.academy-task-layout {
  grid-template-columns: minmax(280px, .75fr) minmax(520px, 2fr);
}

.academy-task-item strong { overflow-wrap: normal; word-break: normal; }

@media (max-width: 900px) {
  .academy-editor-commandbar { align-items: stretch; }
  .academy-context-tabs, .academy-editor-commandbar .academy-editor-heading-actions { width: 100%; }
  .academy-context-tabs button { flex: 1 1 180px; }
  .academy-micro-catalog { grid-template-columns: 1fr; }
  .academy-task-layout { grid-template-columns: 1fr; }
  .academy-task-list { border-bottom: 1px solid var(--academy-line); border-right: 0; max-height: 260px; }
  .academy-course-overview-actions { grid-column: 1 / -1; width: 100%; }
  .academy-course-filter { align-items: stretch; grid-template-columns: minmax(0, 1fr) auto; }
  .academy-course-filter label { grid-column: 1 / -1; }
}

@media (max-width: 1100px) {
  .academy-editor-context {
    grid-template-columns: 1fr;
  }

  .academy-editor-context > details,
  .academy-independent-list {
    border: 1px solid #d8e4ec;
  }
}

@media (max-width: 620px) {
  .academy-editor {
    gap: 14px;
  }

  .academy-editor-heading {
    border-radius: 18px;
  }

  .academy-editor-heading-actions {
    justify-content: stretch;
    max-width: none;
  }

  .academy-editor-heading-actions > button {
    flex: 1 1 100%;
  }

  .academy-editor-path {
    overflow-x: auto;
    padding: 2px;
  }

  .academy-editor-path span,
  .academy-editor-path strong {
    flex: 0 0 auto;
  }

  .academy-editor-heading-with-back { width: 100%; }
  .academy-course-overview-list { padding: 12px; }
  .academy-course-overview-card { padding: 14px; }
  .academy-course-overview-actions { grid-column: 1 / -1; }
  .academy-course-filter { grid-template-columns: minmax(0, 1fr); padding: 12px; }
  .academy-course-filter output { white-space: normal; }
  .academy-course-filter .academy-button-secondary { width: 100%; }
  .academy-resource-status { align-items: start; grid-template-columns: 24px minmax(0, 1fr); }
  .academy-resource-status .academy-button-secondary { grid-column: 1 / -1; width: 100%; }
  .academy-role-picker { padding: 12px; }
  .academy-role-picker-summary { align-items: flex-start; flex-direction: column; }
}

@media (max-width: 600px) {
  .academy-course-overview-card { grid-template-columns: 48px minmax(0, 1fr); gap: 10px 12px; }
  .academy-course-overview-heading { display: grid; justify-content: stretch; }
  .academy-course-overview-heading > .academy-status { justify-self: start; }
  .academy-course-overview-actions { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .academy-course-actions-primary,
  .academy-course-actions-secondary { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; min-width: 0; }
  .academy-course-actions-primary > button:first-child { grid-column: 1 / -1; }
  .academy-course-actions-secondary { border-left: 0; border-top: 1px solid var(--academy-line); padding: 10px 0 0; }
  .academy-course-overview-actions button { justify-content: center; min-height: 44px; min-width: 0; width: 100%; white-space: normal; }
}

/* Modo oscuro: variables primero, luego los colores fijos invertidos
   conservando el tono. Aditivo; el tema claro no se toca. */
[data-theme="dark"] .academy-editor {
  --academy-ink: #f0f3f6;
  --academy-muted: #9aa7b6;
  --academy-line: #333b45;
  --academy-soft: #1c2229;
  --academy-blue: #6faee2;
  --academy-blue-soft: #16222c;
  --academy-green: #58bc87;
  --academy-green-soft: #17241e;
  --academy-amber: #e7b650;
  --academy-amber-soft: #2a2415;
  --academy-red: #f17380;
  --academy-red-soft: #2c1b1e;
  --academy-orange: #f39858;
}
[data-theme="dark"] .academy-editor { background: #171c22; }
[data-theme="dark"] .academy-editor-heading { background: #171c22; }
[data-theme="dark"] .academy-button-secondary, [data-theme="dark"] .academy-icon-button { background: #171c22; }
[data-theme="dark"] .academy-button-danger { background: #171c22; }
[data-theme="dark"] .academy-editor-context summary, [data-theme="dark"] .academy-independent-list > header { background: #171c22; }
[data-theme="dark"] .academy-catalog-search { background: #181d23; }
[data-theme="dark"] .academy-context-item, [data-theme="dark"] .academy-micro-item, [data-theme="dark"] .academy-media-item { background: #171c22; border-bottom: #1f242b; }
[data-theme="dark"] .academy-context-symbol, [data-theme="dark"] .academy-media-symbol { background: #191d22; color: #b1bbcb; }
[data-theme="dark"] .academy-status-neutral, [data-theme="dark"] .academy-status-draft { background: #191d22; color: #aab4c5; }
[data-theme="dark"] .academy-status-muted, [data-theme="dark"] .academy-status-archived { background: #1c2229; color: #b8b8b8; }
[data-theme="dark"] .academy-micro-workspace, [data-theme="dark"] .academy-editor-welcome { background: #171c22; }
[data-theme="dark"] .academy-origin-context { background: #152026; color: #bfcfe3; }
[data-theme="dark"] .academy-field-grid label, [data-theme="dark"] .academy-json-workbench label, [data-theme="dark"] .academy-didactic-content { color: #bdc6d7; }
[data-theme="dark"] .academy-editor input, [data-theme="dark"] .academy-editor select, [data-theme="dark"] .academy-editor textarea { background: #171c22; }
[data-theme="dark"] .academy-trace-panel { background: #161f25; }
[data-theme="dark"] .academy-editor-tooling { background: #171c22; }
[data-theme="dark"] .academy-task-item { background: #171c22; }
[data-theme="dark"] .academy-answer-field { background: #262115; }
[data-theme="dark"] .academy-specialist-preview { background: #171c22; }
[data-theme="dark"] .academy-scene-list { border-top: #20242a; }
[data-theme="dark"] .academy-scene-row { border-bottom: #20242a; }
[data-theme="dark"] .academy-editor-message { color: #e3aaaa; }
[data-theme="dark"] .academy-editor-message.is-conflict { color: #ead4b6; }
[data-theme="dark"] .academy-editor-dialog { background: #171c22; }
[data-theme="dark"] .academy-editor-dialog > header { border-bottom: #1c252e; background: #151d26; }
[data-theme="dark"] .academy-editor-dialog > header p { color: #a7b6c8; }
[data-theme="dark"] .academy-searchable-listbox { background: #171c22; border-color: #405166; }
[data-theme="dark"] .academy-searchable-option { color: #e6edf5; }
[data-theme="dark"] .academy-searchable-option.is-active,
[data-theme="dark"] .academy-searchable-option:hover { background: #162a3c; color: #a9d7fa; }
[data-theme="dark"] .academy-field-error { color: #ff9da8; }
[data-theme="dark"] .academy-role-picker,
[data-theme="dark"] .academy-guided-builder,
[data-theme="dark"] .academy-course-filter { background: #151d26; border-color: #333b45; }
[data-theme="dark"] .academy-role-options,
[data-theme="dark"] .academy-guided-builder .academy-scene-row { background: #171c22; border-color: #333b45; }
[data-theme="dark"] .academy-role-option:hover,
[data-theme="dark"] .academy-role-option:focus-within { background: #162a3c; }
[data-theme="dark"] .academy-guided-builder .academy-answer-field { background: #16241d; border-color: #2d5941; color: #b8ead1; }
[data-theme="dark"] .academy-resource-status { background: #2a2415; border-color: #665727; color: #f0d995; }
[data-theme="dark"] .academy-resource-status small { color: #d2bd7d; }
[data-theme="dark"] .academy-resource-status.is-loading { background: #16222c; border-color: #284a62; color: #b7daf2; }
[data-theme="dark"] .academy-course-overview,
[data-theme="dark"] .academy-course-overview-card { background: #171c22; border-color: #333b45; }
[data-theme="dark"] .academy-course-overview > header { background: #151d26; border-color: #333b45; }
[data-theme="dark"] .academy-independent-entry { background: #162a34; border-color: #344d59; }
[data-theme="dark"] .academy-course-overview-meta, [data-theme="dark"] .academy-course-technical { color: #aeb8c8; }
[data-theme="dark"] .academy-course-overview-progress { background: #2a323b; }
[data-theme="dark"] .academy-status-info { background: #16222c; color: #9fc8e8; }
[data-theme="dark"] .academy-production-status { background: #181d23; color: #aebacb; }
[data-theme="dark"] .academy-production-status.is-succeeded { background: #16241d; color: #b8ead1; }
[data-theme="dark"] .academy-production-status.is-failed, [data-theme="dark"] .academy-production-status.is-rejected { background: #261515; color: #de9898; }
[data-theme="dark"] .academy-production-stage > span { background: #1f242b; border: #171c22; }
[data-theme="dark"] .academy-production-stage b { color: #adb6c2; }
[data-theme="dark"] .academy-production-stage.is-ready b { color: #b8ead1; }
[data-theme="dark"] .academy-production-summary > div { background: #161c25; }
[data-theme="dark"] .academy-production-evidence > div { background: #161c25; }
[data-theme="dark"] .academy-production-summary input, [data-theme="dark"] .academy-production-summary select { background: #171c22; }
[data-theme="dark"] .academy-production-blockers { background: #262115; }
[data-theme="dark"] .academy-production-blockers ul { color: #e9d5b4; }
[data-theme="dark"] .academy-production-approvals > header { background: #151c26; }
[data-theme="dark"] .academy-approval-step summary > span { background: #292f36; }
[data-theme="dark"] .academy-approval-step summary b { color: #abb6c4; }
[data-theme="dark"] .academy-approval-step.is-approved summary b { color: #b8ead1; }
[data-theme="dark"] .academy-approval-step.is-rejected summary b { color: #de9898; }
[data-theme="dark"] .academy-approval-step form { background: #151a26; }
[data-theme="dark"] .academy-approval-step form input, [data-theme="dark"] .academy-approval-step form select, [data-theme="dark"] .academy-approval-step form textarea { background: #171c22; }
[data-theme="dark"] .academy-approval-decision, [data-theme="dark"] .academy-approval-waiting { background: #151a26; }

/* Guided ACL and didactic repeaters: business labels in the UI, stable keys in
   submitted values, and no pipe-delimited authoring conventions. */
.academy-acl-picker,
.academy-didactic-repeater {
  min-width: 0;
  margin: 0;
  padding: 16px;
  border: 1px solid var(--academy-line);
  border-radius: 16px;
  background: var(--academy-soft);
}
.academy-acl-picker > legend,
.academy-didactic-repeater > legend { padding: 0 6px; font-weight: 800; color: var(--academy-ink); }
.academy-acl-picker > p,
.academy-didactic-repeater > p { margin: 0 0 12px; color: var(--academy-muted); font-size: .82rem; }
.academy-acl-search { display: grid; gap: 6px; margin-bottom: 10px; }
.academy-acl-options {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 8px;
  max-height: 320px;
  overflow: auto;
  padding: 4px;
}
.academy-acl-options > label {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 9px 10px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: var(--academy-paper);
  cursor: pointer;
}
.academy-acl-options > label:hover,
.academy-acl-options > label:focus-within { border-color: var(--academy-blue); background: var(--academy-blue-soft); }
.academy-acl-options input { flex: 0 0 auto; width: 18px; height: 18px; margin-top: 2px; }
.academy-acl-options span { display: grid; gap: 2px; min-width: 0; }
.academy-acl-options small { overflow-wrap: anywhere; color: var(--academy-muted); }
.academy-acl-picker[data-invalid] { border-color: var(--academy-red); box-shadow: 0 0 0 3px color-mix(in srgb, var(--academy-red) 16%, transparent); }
.academy-acl-picker > [data-academy-acl-status] { display: block; margin-top: 8px; color: var(--academy-muted); }
.academy-didactic-repeater { grid-column: 1 / -1; }
.academy-didactic-row {
  position: relative;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 12px;
  padding: 14px 50px 14px 14px;
  border: 1px solid var(--academy-line);
  border-radius: 12px;
  background: var(--academy-paper);
}
.academy-didactic-row > label { min-width: 0; }
.academy-didactic-row > label:nth-last-of-type(1):nth-of-type(3) { grid-column: 1 / -1; }
.academy-didactic-remove { position: absolute; top: 10px; right: 10px; }
@media (max-width: 720px) {
  .academy-didactic-row { grid-template-columns: 1fr; padding-right: 46px; }
  .academy-didactic-row > label { grid-column: 1 !important; }
}
[data-theme="dark"] .academy-acl-picker,
[data-theme="dark"] .academy-didactic-repeater { background: #151d26; border-color: #333b45; }
[data-theme="dark"] .academy-acl-options > label,
[data-theme="dark"] .academy-didactic-row { background: #171c22; border-color: #333b45; }
/* The studio cards are newer than the original dark palette. Keep their
   surfaces and inventory controls aligned with the form's dark text. */
[data-theme="dark"] .academy-editor-main,
[data-theme="dark"] .academy-editor-commandbar,
[data-theme="dark"] .academy-editor-catalog,
[data-theme="dark"] .content-studio-gaps,
[data-theme="dark"] .academy-editor-context > details,
[data-theme="dark"] .academy-independent-list { background: #171c22; border-color: #333b45; }
[data-theme="dark"] .academy-editor-catalog > header { background: #151d26; border-color: #333b45; }
[data-theme="dark"] .academy-context-tabs button { background: #20303c; border-color: #405166; color: #e6edf5; }
[data-theme="dark"] .academy-context-tabs button.is-active { background: #16323b; border-color: #3b7682; color: #d6f5f6; }
[data-theme="dark"] .academy-context-tabs strong { background: #101a22; color: #e6edf5; }
/* Publication readiness and persistent audience selection. */
.academy-generation-availability { display:inline-flex; flex-direction:column; gap:5px; max-width:320px; }
.academy-generation-availability small { font-size:12px; line-height:1.4; }
.academy-editor .academy-course-proposal {
  min-width: 0; margin: 16px 0; padding: 18px;
  border: 1px solid var(--academy-line, #d8dee8); border-radius: 12px;
  background: var(--academy-soft, #f4f7fa);
  display: grid; gap: 12px; overflow-wrap: anywhere;
}
.academy-editor .academy-course-proposal h3 { margin: 0; font-size: 18px; line-height: 1.35; }
.academy-editor .academy-course-proposal p { margin: 0; line-height: 1.5; }
.academy-editor .academy-course-proposal-lead { color: var(--academy-ink, #17233b); }
.academy-editor .academy-course-proposal-manual,
.academy-editor .academy-course-proposal-meta { color: var(--academy-muted, #5f6b7f); font-size: 13px; }
.academy-editor .academy-course-proposal-field,
.academy-editor .academy-course-proposal-sources {
  min-width: 0; padding: 10px 12px; border: 1px solid var(--academy-line, #d8dee8);
  border-radius: 8px; background: #fff;
}
.academy-editor .academy-course-proposal-field > summary,
.academy-editor .academy-course-proposal-sources > summary {
  cursor: pointer; font-weight: 700; line-height: 1.4; overflow-wrap: anywhere;
}
.academy-editor .academy-course-proposal-field[open],
.academy-editor .academy-course-proposal-sources[open] { display: grid; gap: 12px; }
.academy-editor .academy-course-proposal-value { white-space: pre-line; overflow-wrap: anywhere; }
.academy-editor ol.academy-course-proposal-value { display: grid; gap: 8px; line-height: 1.5; margin: 0; padding-left: 20px; white-space: normal; }
.academy-editor .academy-course-proposal-value li { padding-left: 2px; }
.academy-editor p.academy-course-proposal-value { line-height: 1.5; margin: 0; }
.academy-editor .academy-course-proposal-field button { justify-self: start; max-width: 100%; white-space: normal; text-align: center; }
.academy-editor .academy-course-proposal-field small { color: var(--academy-red, #a43131); }
.academy-editor .academy-course-proposal-sources ol { margin: 0; padding-left: 22px; display: grid; gap: 10px; }
.academy-editor .academy-course-proposal-sources li { padding-left: 2px; }
.academy-editor .academy-course-proposal-sources li p { margin-top: 4px; }
[data-theme="dark"] .academy-editor .academy-course-proposal { background: #171c22; border-color: #405166; }
[data-theme="dark"] .academy-editor [data-integrated-ai] .academy-generation-inline {
  background: #171c22; border-color: #405166; color: #e6edf5;
}
[data-theme="dark"] .academy-editor .academy-course-proposal-field,
[data-theme="dark"] .academy-editor .academy-course-proposal-sources { background: #202932; border-color: #405166; }
[data-theme="dark"] .academy-editor .academy-course-proposal-field > summary,
[data-theme="dark"] .academy-editor .academy-course-proposal-sources > summary { color: #e6edf5; }
[data-theme="dark"] .academy-editor .academy-course-proposal-lead { color: #e6edf5; }
[data-theme="dark"] .academy-editor .academy-course-proposal-manual,
[data-theme="dark"] .academy-editor .academy-course-proposal-meta { color: #b9c9d9; }
@media (max-width: 600px) {
  .academy-editor .academy-editor-dialog form:has([data-integrated-ai]) { padding-inline: 14px; }
  .academy-editor [data-integrated-ai] .academy-generation-inline .academy-generation-body { padding-inline: 8px; }
  .academy-editor .academy-course-proposal { padding: 12px; }
  .academy-editor .academy-course-proposal-field button { width: 100%; }
}
.academy-publication-preflight { margin:16px 0; padding:16px; border:1px solid var(--border,#cbd5e1); border-radius:14px; }
.academy-publication-preflight [data-passed="false"] { color:#a8202b; font-weight:600; }
.academy-publication-preflight [data-passed="true"] { color:#13724d; }
.academy-selected-profiles { display:flex; flex-wrap:wrap; gap:8px; margin:12px 0; }
.academy-selected-profile { display:inline-flex; align-items:center; gap:8px; max-width:100%; padding:6px 10px; border:1px solid #97b9c5; border-radius:18px; background:#eaf6fa; color:#123b4c; }
.academy-selected-profile span { overflow-wrap:anywhere; }
.academy-selected-profile button { flex:0 0 24px; min-width:24px; width:24px; height:24px; padding:0; border:0; background:transparent; color:inherit; cursor:pointer; }
[data-theme="dark"] .academy-role-picker-summary [data-academy-role-selected] { color:#83d4d4; }
[data-theme="dark"] .academy-selected-profile { background:#16323b; border-color:#3b7682; color:#d6f5f6; }
[data-theme="dark"] .academy-publication-preflight [data-passed="false"] { color:#ff9fa8; }
[data-theme="dark"] .academy-publication-preflight [data-passed="true"] { color:#8ee0b6; }

/* Supervisory assessment audit: immutable attempts and their associated review. */
.assessment-audit { margin-top: 16px; }
.assessment-audit__person { padding: 12px 0; border-top: 1px solid var(--border-soft, #d8e4ec); }
.assessment-audit__person > summary {
  min-height: 44px;
  display: flex;
  align-items: center;
  cursor: pointer;
  font-weight: 750;
  overflow-wrap: anywhere;
}
.assessment-audit__person > summary:focus-visible {
  outline: 2px solid var(--brand, #287787);
  outline-offset: 3px;
}
.assessment-audit__activity { min-width: 0; padding: 12px 0; }
.assessment-audit__attempts { display: grid; gap: 12px; padding-left: 24px; }
.assessment-audit__attempt {
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--border-soft, #d8e4ec);
  border-radius: 10px;
  background: var(--surface-subtle, #f8fafc);
  overflow-wrap: anywhere;
}
.assessment-audit__attempt h5 { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.assessment-audit dl { display: grid; grid-template-columns: minmax(150px, 220px) minmax(0, 1fr); gap: 6px 12px; }
.assessment-audit dt { font-weight: 750; }
.assessment-audit dd { min-width: 0; margin: 0; }
.assessment-audit code { white-space: normal; overflow-wrap: anywhere; }
.assessment-audit__review { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--border-soft, #d8e4ec); }
/* Course catalog controls keep their own row on narrow screens. */
[data-theme="dark"] .academy-course-overview .academy-button-primary {
  background: #83c9ec;
  border-color: #83c9ec;
  color: #10233f !important;
}
@media (max-width: 600px) {
  .academy-course-overview > header { flex-direction: column; align-items: stretch; gap: 16px; }
  .academy-independent-entry { align-items: stretch; flex-direction: column; padding: 16px; }
  .academy-independent-entry button { justify-content: center; width: 100%; }
  .academy-course-overview > header .academy-editor-heading-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
    gap: 8px;
  }
  .academy-course-overview > header .academy-editor-heading-actions button {
    min-width: 0;
    min-height: 44px;
    justify-content: center;
  }
  .academy-course-overview > header [data-action="refresh-editor"] { grid-column: 1 / -1; }
}
[data-theme="dark"] .assessment-audit__attempt { background: #171c22; border-color: #333b45; }
[data-theme="dark"] .assessment-audit__person,
[data-theme="dark"] .assessment-audit__review { border-color: #333b45; }
@media (max-width: 520px) {
  .assessment-audit__attempts { padding-left: 20px; }
  .assessment-audit dl { grid-template-columns: 1fr; }
}

/* R13 UX pass (2026-09-21): manual QA findings in the course form. */
/* Profile search uses an 18px icon column; errors must span the full row. */
.academy-role-picker-search > .academy-field-error {
  grid-column: 1 / -1;
  grid-row: 2;
  margin-top: 6px;
}
/* Field help belongs next to the fieldset title, not orphaned below the list. */
.academy-role-picker { position: relative; }
.academy-role-picker > .academy-field-help {
  position: absolute;
  right: 14px;
  top: -2px;
}
/* No blank gap when nothing is selected yet. */
.academy-selected-profiles:empty { display: none; }
/* The technical identifier toggle spans the row, so its divider is not an orphan line. */
.academy-advanced { grid-column: 1 / -1; }
/* Open lists scroll under the sticky dialog header instead of covering it. */
.academy-editor-dialog > header { z-index: 30; }
/* Open course heading shows its persisted status, scope and audience. */
.academy-course-heading-meta { align-items: center; display: flex; flex-wrap: wrap; gap: 6px 12px; margin-top: 8px; }
.academy-course-heading-meta > span:not(.academy-status) { color: var(--academy-muted); font-size: 12px; font-weight: 700; }
/* AI entry inside the course/micro form: full-width button row, reason below. */
[data-integrated-ai] > button { display: inline-flex; margin: 10px 0 0; max-width: 100%; white-space: nowrap; }
[data-integrated-ai] > small[role="status"] { display: block; line-height: 1.45; margin-top: 8px; }
/* Step 4 review: compact list, same scale as the rest of the form. */
.academy-course-review { gap: 6px; }
.academy-course-review > p { font-size: 13px; line-height: 1.45; margin: 0; }
.academy-course-review > .academy-step-label { margin: 0 0 4px; }
/* Confirmation dialog: no empty bordered box when there are no details. */
.confirmation-details:empty { display: none; }
