/* Syllabus rich step body — editor + readers (phone-first single column) */

.rcs-syl-rich {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
  max-width: 100%;
}

.rcs-syl-rich__bar {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 4px 0;
}

.rcs-syl-rich__btn {
  min-width: 36px;
  min-height: 36px;
  padding: 6px 8px;
  border-radius: 8px;
  border: 1px solid var(--rcs-border, rgba(148, 163, 184, 0.35));
  background: var(--rcs-panel, rgba(15, 23, 42, 0.45));
  color: var(--rcs-text, #f9fafb);
  font: inherit;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  cursor: pointer;
  touch-action: manipulation;
}

[data-theme="light"] .rcs-syl-rich__btn {
  background: #fff;
  color: #0f172a;
}

.rcs-syl-rich__btn:hover {
  border-color: var(--rcs-accent, #38bdf8);
}

.rcs-syl-rich__btn.is-active,
.rcs-syl-rich__btn[aria-pressed="true"] {
  border-color: var(--rcs-accent, #38bdf8);
  background: rgba(56, 189, 248, 0.22);
  color: var(--rcs-accent, #38bdf8);
  box-shadow: inset 0 0 0 1px rgba(56, 189, 248, 0.35);
}

[data-theme="light"] .rcs-syl-rich__btn.is-active,
[data-theme="light"] .rcs-syl-rich__btn[aria-pressed="true"] {
  background: rgba(14, 165, 233, 0.16);
  color: #0369a1;
  box-shadow: inset 0 0 0 1px rgba(14, 165, 233, 0.35);
}

.rcs-syl-rich__ed {
  min-height: 88px;
  max-width: 100%;
  box-sizing: border-box;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--rcs-border, rgba(148, 163, 184, 0.35));
  background: var(--rcs-input-bg, rgba(2, 6, 23, 0.35));
  color: var(--rcs-text, #f9fafb);
  font: inherit;
  font-size: 0.95rem;
  font-weight: 400;
  line-height: 1.45;
  overflow-x: auto;
  overflow-wrap: anywhere;
  word-break: break-word;
  touch-action: pan-x pan-y pinch-zoom;
}

[data-theme="light"] .rcs-syl-rich__ed {
  background: #fff;
  color: #0f172a;
}

.rcs-syl-rich.is-disabled .rcs-syl-rich__ed {
  opacity: 0.7;
  pointer-events: none;
}

.rcs-syl-rich__ed:focus {
  outline: 2px solid var(--rcs-accent, #38bdf8);
  outline-offset: 1px;
}

.rcs-syl-rich__ed > :first-child {
  margin-top: 0;
}

.rcs-syl-rich__ed > :last-child {
  margin-bottom: 0;
}

/* Shared rendered content (editor + student + Field Ops) */
.rcs-syl-body,
.rcs-syl-rich__ed {
  color: inherit;
}

.rcs-syl-body h3,
.rcs-syl-rich__ed h3 {
  margin: 0.75em 0 0.35em;
  font-size: 1.05rem;
  /* Lighter than <strong> (800) so bold inside a heading is visible */
  font-weight: 600;
  line-height: 1.25;
}

.rcs-syl-body p,
.rcs-syl-rich__ed p {
  margin: 0 0 0.55em;
}

.rcs-syl-body ul,
.rcs-syl-body ol,
.rcs-syl-rich__ed ul,
.rcs-syl-rich__ed ol {
  margin: 0 0 0.65em;
  padding-left: 1.25em;
}

.rcs-syl-body li,
.rcs-syl-rich__ed li {
  margin: 0.15em 0;
}

.rcs-syl-body b,
.rcs-syl-body strong,
.rcs-syl-rich__ed b,
.rcs-syl-rich__ed strong {
  font-weight: 800;
}

.rcs-syl-body u,
.rcs-syl-rich__ed u {
  text-decoration: underline;
}

.rcs-syl-fig {
  margin: 0.75em 0;
  max-width: 100%;
}

.rcs-syl-fig img {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.2);
}

.rcs-syl-fig figcaption {
  margin-top: 6px;
  font-size: 0.8rem;
  color: var(--rcs-muted, #94a3b8);
  line-height: 1.35;
}

.rcs-syl-table {
  width: 100%;
  max-width: 100%;
  border-collapse: collapse;
  margin: 0.65em 0;
  font-size: 0.88rem;
  display: block;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.rcs-syl-table tbody {
  display: table;
  width: 100%;
  min-width: 100%;
}

.rcs-syl-table th,
.rcs-syl-table td {
  border: 1px solid var(--rcs-border, rgba(148, 163, 184, 0.35));
  padding: 6px 8px;
  text-align: left;
  vertical-align: top;
  word-break: break-word;
}

.rcs-syl-table th {
  font-weight: 800;
  background: rgba(148, 163, 184, 0.12);
}

.rcs-syl-callout {
  margin: 0.7em 0;
  padding: 10px 12px;
  border-radius: 10px;
  border-left: 4px solid var(--rcs-accent, #38bdf8);
  background: rgba(56, 189, 248, 0.1);
  font-size: 0.92rem;
}

.rcs-syl-callout--warn {
  border-left-color: #f59e0b;
  background: rgba(245, 158, 11, 0.12);
}

.rcs-syl-callout > :first-child {
  margin-top: 0;
}

.rcs-syl-callout > :last-child {
  margin-bottom: 0;
}

/* Readers: drop pre-wrap when rich class is used */
.rcs-syl-body {
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
  max-width: 100%;
}
