.ml-review-shell {
  --mlr-ink: #14233b;
  --mlr-muted: #5d6b82;
  --mlr-line: #d8e0ea;
  --mlr-blue: #0f5b96;
  --mlr-blue-soft: #eaf4fb;
  --mlr-green: #137a53;
  --mlr-orange: #a94b10;
  color: var(--mlr-ink);
  display: grid;
  gap: 16px;
  min-width: 0;
}

/* Sin título propio: la banda que aloja la bandeja ya lo lleva. */
.ml-review-hero {
  align-items: center;
  border-bottom: 1px solid var(--mlr-line);
  display: flex;
  gap: 24px;
  justify-content: space-between;
  padding: 0 2px 14px;
}

.ml-review-item h2,
.ml-review-item h3,
.ml-review-state h2 { margin: 0; }
.ml-review-hero p { color: var(--mlr-muted); line-height: 1.55; margin: 0; max-width: 760px; }
.ml-review-filter { display: grid; gap: 6px; margin: 0 0 16px; }
.ml-review-filter span { font-size: 12px; font-weight: 800; text-transform: uppercase; color: var(--mlr-muted); }
.ml-review-filter input { border: 1px solid #b9c6d5; box-sizing: border-box; font: inherit; padding: 10px 12px; width: 100%; }
.ml-review-hero > strong { background: var(--mlr-blue-soft); color: var(--mlr-blue); padding: 8px 12px; white-space: nowrap; }
.ml-review-kicker { color: var(--mlr-blue); display: block; font-size: 12px; font-weight: 800; margin-bottom: 6px; text-transform: uppercase; }

.ml-review-scroll {
  max-height: calc(100vh - 220px);
  min-height: 320px;
  overflow: auto;
  overscroll-behavior: contain;
  padding-right: 8px;
  scrollbar-gutter: stable;
}

.ml-review-item { border-bottom: 1px solid var(--mlr-line); padding: 22px 0 28px; }
.ml-review-item:first-child { padding-top: 4px; }
.ml-review-item-header { align-items: start; display: flex; gap: 18px; justify-content: space-between; }
.ml-review-item-header h2 { font-size: 21px; line-height: 1.3; }
.ml-review-item-header time { color: var(--mlr-muted); font-size: 13px; white-space: nowrap; }

/* Decision del usuario 2026-09-21 («Abrir revision»): aviso para quien revisa
   fuera de la audiencia. Usa las variables del contenedor, asi que el tema
   oscuro lo hereda sin reglas propias. */
.ml-review-access-note { background: var(--mlr-blue-soft); border-left: 3px solid var(--mlr-blue); color: var(--mlr-ink); line-height: 1.5; margin: 14px 0 0; padding: 10px 14px; }
.ml-review-access-note strong { color: var(--mlr-blue); }
.ml-review-context { display: grid; gap: 1px; grid-template-columns: repeat(3, minmax(0, 1fr)); margin: 18px 0; }
.ml-review-context div { background: #f5f7fa; padding: 12px 14px; }
.ml-review-context dt { color: var(--mlr-muted); font-size: 12px; font-weight: 700; margin-bottom: 5px; text-transform: uppercase; }
.ml-review-context dd { font-weight: 700; margin: 0; overflow-wrap: anywhere; }
.ml-review-context small { color: var(--mlr-muted); display: block; font-weight: 400; margin-top: 4px; }

.ml-review-instruction,
.ml-review-criteria,
.ml-review-response { margin: 18px 0; }
.ml-review-instruction h3,
.ml-review-criteria h3,
.ml-review-response h3 { font-size: 14px; margin-bottom: 8px; }
.ml-review-instruction p { color: var(--mlr-muted); line-height: 1.55; margin: 0; }
.ml-review-criteria { background: #f5f7fa; border-left: 4px solid var(--mlr-green); padding: 14px 16px; }
.ml-review-criteria ul { display: grid; gap: 7px; line-height: 1.5; margin: 0; padding-left: 20px; }
.ml-review-criteria strong { text-transform: capitalize; }
.ml-review-response div { background: var(--mlr-blue-soft); border-left: 4px solid var(--mlr-blue); line-height: 1.65; overflow-wrap: anywhere; padding: 16px; white-space: normal; }

.ml-review-form { border-top: 1px solid var(--mlr-line); display: grid; gap: 18px; grid-template-columns: 1fr 180px; padding-top: 20px; }
.ml-review-form fieldset { border: 0; margin: 0; min-width: 0; padding: 0; }
.ml-review-form legend,
.ml-review-field > span { display: block; font-weight: 800; margin-bottom: 8px; }
.ml-review-segmented { display: grid; gap: 6px; grid-template-columns: 1fr 1fr; }
.ml-review-segmented label { cursor: pointer; position: relative; }
.ml-review-segmented input { height: 1px; opacity: 0; position: absolute; width: 1px; }
.ml-review-segmented span { align-items: center; border: 1px solid var(--mlr-line); display: flex; font-weight: 700; justify-content: center; min-height: 42px; padding: 8px; }
.ml-review-segmented input:checked + span { background: var(--mlr-blue); border-color: var(--mlr-blue); color: white; }
.ml-review-segmented input:focus-visible + span { outline: 3px solid #84b7dc; outline-offset: 2px; }
.ml-review-help,
.ml-review-field small { color: var(--mlr-muted); display: block; font-size: 12px; line-height: 1.4; margin: 7px 0 0; }
.ml-review-field { min-width: 0; }
.ml-review-field textarea,
.ml-review-field input { border: 1px solid #b9c6d5; box-sizing: border-box; color: var(--mlr-ink); font: inherit; padding: 10px 12px; width: 100%; }
.ml-review-field textarea { min-height: 104px; resize: vertical; }
.ml-review-field:has(textarea) { grid-column: 1 / -1; }
.ml-review-field textarea:focus,
.ml-review-field input:focus { border-color: var(--mlr-blue); outline: 3px solid #d4e8f6; }
.ml-review-field-error,
.ml-review-field b { color: #a12424; display: block; font-size: 12px; font-weight: 700; min-height: 17px; margin: 5px 0 0; }

.ml-review-actions { align-items: center; display: flex; gap: 16px; grid-column: 1 / -1; justify-content: space-between; }
.ml-review-actions p { color: var(--mlr-muted); margin: 0; }
.ml-review-button { border: 1px solid var(--mlr-blue); cursor: pointer; font: inherit; font-weight: 800; min-height: 42px; padding: 9px 16px; }
.ml-review-button.primary { background: var(--mlr-blue); color: white; }
.ml-review-button:disabled { cursor: wait; opacity: .6; }
.ml-review-button:focus-visible,
.ml-review-notice button:focus-visible { outline: 3px solid #84b7dc; outline-offset: 2px; }

.ml-review-notice { align-items: center; display: flex; gap: 10px; padding: 12px 14px; }
.ml-review-notice span { flex: 1; }
.ml-review-notice.success { background: #e8f5ef; color: var(--mlr-green); }
.ml-review-notice.warning { background: #fff1e7; color: var(--mlr-orange); }
.ml-review-notice button { background: transparent; border: 1px solid currentColor; color: inherit; cursor: pointer; font: inherit; font-weight: 800; padding: 7px 10px; }

.ml-review-state { align-items: center; display: flex; flex-direction: column; justify-content: center; min-height: 320px; padding: 32px; text-align: center; }
.ml-review-state > span { align-items: center; background: var(--mlr-blue-soft, #eaf4fb); color: var(--mlr-blue, #0f5b96); display: flex; font-weight: 900; height: 54px; justify-content: center; margin-bottom: 16px; width: 54px; }
.ml-review-state p { color: var(--mlr-muted, #5d6b82); line-height: 1.55; max-width: 520px; }

.ml-review-pagination {
  align-items: center;
  border-top: 1px solid var(--mlr-line);
  display: flex;
  gap: 12px;
  justify-content: space-between;
  padding: 14px 0 0;
}

.ml-review-pagination span {
  color: var(--mlr-muted);
  font-size: 13px;
  text-align: center;
}

.ml-review-pagination .ml-review-button:disabled {
  cursor: not-allowed;
  opacity: .5;
}

@media (max-width: 760px) {
  .ml-review-hero,
  .ml-review-item-header,
  .ml-review-actions { align-items: stretch; flex-direction: column; }
  .ml-review-context,
  .ml-review-form { grid-template-columns: 1fr; }
  .ml-review-field:has(textarea),
  .ml-review-actions { grid-column: 1; }
  .ml-review-scroll { max-height: calc(100vh - 180px); padding-right: 3px; }
  .ml-review-button { width: 100%; }
  .ml-review-pagination { align-items: stretch; flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
  .ml-review-shell * { scroll-behavior: auto !important; transition: none !important; }
}
.rh-review-band {
  margin-top: 24px;
  min-width: 0;
}

.rh-review-band > .section-heading.compact {
  margin-bottom: 12px;
}

#microlearningReviewRoot {
  min-width: 0;
}

/* Modo oscuro: variables primero, luego los colores fijos invertidos
   conservando el tono. Aditivo; el tema claro no se toca. */
[data-theme="dark"] .ml-review-shell {
  --mlr-ink: #f0f3f6;
  --mlr-muted: #9aa7b6;
  --mlr-line: #333b45;
  --mlr-blue: #6faee2;
  --mlr-blue-soft: #16222c;
  --mlr-green: #58bc87;
  --mlr-orange: #f39858;
}
[data-theme="dark"] .ml-review-context div { background: #181c23; }
[data-theme="dark"] .ml-review-criteria { background: #181c23; }
[data-theme="dark"] .ml-review-field-error, [data-theme="dark"] .ml-review-field b { color: #df9090; }
[data-theme="dark"] .ml-review-notice.success { background: #17241e; }
[data-theme="dark"] .ml-review-notice.warning { background: #261c15; }
[data-theme="dark"] .ml-review-state > span { background: #151f26; color: #9fc5e3; }
[data-theme="dark"] .ml-review-state p { color: #acb5c3; }
