:root {
  --ink: #0f172a;
  --ink-2: #1e293b;
  --muted: #64748b;
  --faint: #94a3b8;
  --paper: #ffffff;
  --paper-cool: #f8fafc;
  --paper-tint: #f1f5f9;
  --line: #e2e8f0;
  --line-strong: #cbd5e1;
  --brand: #1e40af;
  --brand-light: #3b82f6;
  --brand-dark: #1e3a8a;
  --brand-wash: #eff6ff;
  --accent: #f97316;
  --accent-dark: #c2410c;
  --accent-wash: #fff7ed;
  --success: #059669;
  --danger: #dc2626;
  --footer: #050914;
  --radius: 8px;
  --font-display: "Playfair Display", Georgia, serif;
  --font-sans: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --shadow-card: 0 1px 3px rgba(15,23,42,.06), 0 1px 2px rgba(15,23,42,.04);
  --shadow-hover: 0 20px 60px -8px rgba(15,23,42,.13), 0 8px 16px -4px rgba(15,23,42,.06);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
body {
  margin: 0;
  font-family: var(--font-sans);
  background: var(--paper-cool);
  color: var(--ink);
  line-height: 1.68;
}
body::selection { background: rgba(30, 64, 175, .18); }
a { color: var(--brand); text-decoration: none; transition: color .18s ease; }
a:hover { color: var(--accent-dark); }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 3px solid rgba(59,130,246,.32);
  outline-offset: 3px;
}
main { min-height: calc(100vh - 220px); }
.reading-progress {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 1000;
  width: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--brand), var(--accent));
}
h1, h2, h3 {
  font-family: var(--font-display);
  letter-spacing: 0;
  line-height: 1.08;
  color: var(--ink);
}

.contact-strip {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
  padding: 8px clamp(18px, 4vw, 56px);
  background: #0a0a0a;
  color: rgba(255,255,255,.82);
  font-size: .82rem;
  font-weight: 700;
}
.contact-strip a { color: #ffffff; }
.contact-links { display: flex; flex-wrap: wrap; gap: 1rem; align-items: center; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(255,255,255,.92);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(24px) saturate(180%);
}
.topbar-inner {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: center;
  width: min(1280px, calc(100% - 32px));
  margin: 0 auto;
  padding: 13px 0;
}
.brand, .footer-brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: var(--ink);
  font-weight: 900;
}
.brand:hover, .footer-brand:hover { text-decoration: none; }
.brand-mark {
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--accent-dark), var(--accent));
  color: #fff;
  font-family: var(--font-display);
  font-size: 1.55rem;
  font-weight: 900;
  box-shadow: 0 10px 24px rgba(249,115,22,.28);
}
.brand-text { display: grid; line-height: .95; }
.brand-text strong, .footer-brand strong {
  font-family: var(--font-display);
  font-size: 1.7rem;
  letter-spacing: 0;
}
.brand-text strong span { color: var(--accent-dark); }
.brand-text em, .footer-brand em {
  font-style: normal;
  color: var(--accent-dark);
  font-size: .72rem;
  font-weight: 900;
  letter-spacing: .18em;
  text-transform: uppercase;
}
.nav { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 4px 16px; align-items: center; }
.nav a:not(.button), .link-button {
  position: relative;
  color: var(--muted);
  font-weight: 700;
  font-size: .92rem;
}
.nav a:not(.button)::after, .link-button::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -7px;
  width: 0;
  height: 2px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--brand), var(--accent));
  transform: translateX(-50%);
  transition: width .22s ease;
}
.nav a:not(.button):hover::after, .link-button:hover::after { width: 24px; }
.inline-form { display: inline; margin: 0; }
.link-button { border: 0; background: none; cursor: pointer; font: inherit; padding: 0; }

.hero, .course-hero, .page-header, .section, .learning-layout, .auth-card, .table-wrap, .dashboard-grid {
  width: min(1180px, calc(100% - 32px));
  margin: 30px auto;
}
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 28px;
  align-items: stretch;
  min-height: 520px;
  padding: clamp(30px, 6vw, 70px);
  border-radius: 0;
  background:
    linear-gradient(180deg, rgba(15,23,42,.94), rgba(15,23,42,.7)),
    linear-gradient(135deg, #0f172a, #1e3a8a 54%, #c2410c);
  color: #fff;
  box-shadow: var(--shadow-hover);
}
.hero h1 {
  margin: 0 0 14px;
  color: #fff;
  font-size: clamp(2.35rem, 6vw, 5rem);
  font-weight: 900;
  text-wrap: balance;
}
.hero p { max-width: 720px; color: rgba(255,255,255,.86); }
.eyebrow {
  display: inline-flex;
  width: fit-content;
  padding: 7px 16px;
  border-radius: 999px;
  background: var(--accent-dark);
  color: #fff;
  text-transform: uppercase;
  letter-spacing: .14em;
  font-weight: 900;
  font-size: .68rem;
}

.search-panel, .enroll-panel, .course-card, .category-card, .auth-card, .panel {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
}
.search-panel { padding: 20px; display: grid; gap: 14px; color: var(--ink); align-self: center; }
label { font-weight: 800; display: grid; gap: 6px; }
input, select, textarea {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  padding: 11px 12px;
  font: inherit;
  background: #fff;
}
.checkbox-row { grid-template-columns: auto 1fr; align-items: center; font-weight: 700; }
.checkbox-row input, .choice input { width: auto; }

.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 22px; }
.button {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  min-height: 43px;
  padding: 10px 18px;
  border: 1px solid var(--brand);
  border-radius: 999px;
  background: var(--brand);
  color: #fff;
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(30,64,175,.18);
}
.button:hover { background: var(--brand-dark); color: #fff; text-decoration: none; transform: translateY(-1px); }
.button.ghost { background: #fff; color: var(--brand-dark); border-color: var(--line-strong); box-shadow: none; }
.button.ghost:hover { border-color: var(--accent); color: var(--accent-dark); background: var(--accent-wash); }
.button.small { min-height: 34px; padding: 7px 12px; font-size: .88rem; }
.button.full { width: 100%; }

.section-heading { display: flex; justify-content: space-between; gap: 16px; align-items: end; margin-bottom: 20px; }
.section-heading h2, .page-header h1 { margin: 0; font-size: clamp(1.8rem, 3vw, 2.65rem); font-weight: 900; }
.section-heading h2::after, .page-header h1::after {
  content: "";
  display: block;
  width: 54px;
  height: 4px;
  margin-top: 10px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--brand), var(--accent));
}
.section-heading p, .page-header p, .muted { color: var(--muted); }
.category-grid, .course-grid, .detail-grid, .dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 18px;
}
.course-grid.compact { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.category-card, .course-card, .panel {
  padding: 20px;
  transition: transform .24s ease, box-shadow .24s ease, border-color .24s ease;
}
.category-card:hover, .course-card:hover, .panel:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-hover);
  border-color: rgba(30,64,175,.22);
  text-decoration: none;
}
.category-card { display: grid; gap: 8px; color: var(--ink); }
.category-icon { font-size: 1.7rem; color: var(--accent); }
.course-card { display: grid; gap: 12px; position: relative; overflow: hidden; }
.course-card::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--brand), var(--accent));
}
.course-card h3 { margin: 0; font-size: 1.25rem; font-weight: 900; }
.card-topline { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.badge {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--brand-wash);
  color: var(--brand-dark);
  font-size: .72rem;
  font-weight: 900;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.badge.premium { background: var(--accent-wash); color: var(--accent-dark); }
.meta-grid { display: grid; gap: 8px; margin: 0; }
.meta-grid div { display: flex; justify-content: space-between; gap: 12px; border-top: 1px solid var(--line); padding-top: 8px; }
dt { color: var(--muted); }
dd { margin: 0; font-weight: 800; text-align: right; }
.subtle { background: var(--paper-tint); padding: 26px; border-radius: 8px; }

.course-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 22px;
  align-items: start;
  padding: 28px;
  background: var(--paper);
  border: 1px solid var(--line);
}
.course-hero h1 { font-size: clamp(2rem, 4vw, 3.8rem); margin: 10px 0; font-weight: 900; }
.enroll-panel { padding: 20px; display: grid; gap: 12px; position: sticky; top: 96px; }
.progress { height: 10px; background: #e2e8f0; border-radius: 999px; overflow: hidden; }
.progress span { display: block; height: 100%; background: linear-gradient(90deg, var(--brand), var(--accent)); }
.detail-grid article, .reader, .chapter-nav {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 22px;
}
.auth-card { max-width: 540px; padding: 26px; }
.auth-card.wide { max-width: 780px; }
.form-stack { display: grid; gap: 14px; }
.form-stack p { margin: 0; display: grid; gap: 6px; }

.learning-layout { display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: 18px; align-items: start; }
.chapter-nav { position: sticky; top: 96px; display: grid; gap: 8px; }
.chapter-nav a {
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 8px;
  padding: 10px;
  border-radius: 8px;
  color: var(--ink);
}
.chapter-nav a.active { background: var(--brand-wash); color: var(--brand-dark); font-weight: 900; }
.chapter-nav a.done span { background: var(--brand); color: #fff; }
.chapter-nav span {
  display: inline-grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 999px;
  background: #e2e8f0;
  font-family: var(--font-mono);
  font-size: .78rem;
}
.reader h1 { margin-top: 0; font-size: clamp(1.9rem, 4vw, 3.15rem); font-weight: 900; }
.lead { color: var(--muted); font-size: 1.08rem; }
.content-block { border-top: 1px solid var(--line); padding-top: 20px; margin-top: 20px; }
.content-block img, .content-block video { width: 100%; max-height: 520px; object-fit: contain; border-radius: 8px; background: #0f172a; }
.text-content { font-size: 1.03rem; }
.quiz-box {
  margin-top: 28px;
  padding: 20px;
  border: 1px solid rgba(30,64,175,.18);
  border-radius: 8px;
  background: var(--brand-wash);
}
.quiz-box.final { background: var(--accent-wash); border-color: #fed7aa; }
fieldset { border: 1px solid var(--line); border-radius: 8px; padding: 14px; background: rgba(255,255,255,.65); }
legend { font-weight: 900; padding: 0 6px; }
.choice { display: flex; grid-template-columns: none; align-items: center; gap: 8px; font-weight: 600; margin: 8px 0; }
.reader-actions { display: flex; justify-content: space-between; gap: 12px; margin-top: 24px; }
.split { display: flex; justify-content: space-between; gap: 16px; align-items: center; }
.table-wrap, .dashboard-grid { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; background: #fff; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
th, td { padding: 12px; border-bottom: 1px solid var(--line); text-align: left; }
th { background: var(--brand-wash); color: var(--brand-dark); }
.actions-cell { display: flex; flex-wrap: wrap; gap: 10px; }
.review-row { display: grid; gap: 8px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.messages { width: min(1180px, calc(100% - 32px)); margin: 12px auto 0; display: grid; gap: 8px; }
.message { padding: 12px 14px; border-radius: 8px; border: 1px solid var(--line); background: #fff; }
.message.success { border-color: #86efac; background: #f0fdf4; }
.message.error { border-color: #fecaca; background: #fef2f2; }
.message.warning { border-color: #fed7aa; background: #fff7ed; }

.footer {
  position: relative;
  display: grid;
  grid-template-columns: minmax(260px, 1.4fr) minmax(180px, .7fr) minmax(180px, .7fr);
  gap: clamp(1.5rem, 4vw, 4rem);
  padding: clamp(42px, 7vw, 72px) clamp(18px, 4vw, 56px);
  background:
    linear-gradient(90deg, transparent, rgba(96,165,250,.32), rgba(249,115,22,.28), transparent) top / 100% 3px no-repeat,
    linear-gradient(135deg, #070d18 0%, #0b1530 52%, #050914 100%);
  color: rgba(226,232,240,.82);
}
.footer a { color: rgba(226,232,240,.82); }
.footer a:hover { color: #fff; }
.footer-brand { color: #fff; margin-bottom: 1rem; }
.footer-brand strong { color: #fff; }
.footer-main p { max-width: 520px; margin: 0; color: rgba(203,213,225,.78); }
.footer-links { display: grid; gap: .55rem; align-content: start; }
.footer-links strong {
  color: #fff;
  font-size: .78rem;
  font-weight: 900;
  letter-spacing: .16em;
  text-transform: uppercase;
}

.editor-page { width: min(1320px, calc(100% - 32px)); margin: 30px auto; }
.editor-heading {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-start;
  margin-bottom: 18px;
}
.editor-heading h1 { margin: 0; font-size: clamp(2rem, 4vw, 3.5rem); font-weight: 900; }
.chapter-editor {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 18px;
  align-items: start;
}
.editor-document {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow-card);
  padding: clamp(18px, 3vw, 28px);
}
.editor-meta {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(220px, 1fr) 120px;
  gap: 14px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}
.editor-meta label:first-child { grid-column: 1 / -1; }
.editor-title-input {
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  font-weight: 900;
}
.office-toolbar {
  position: sticky;
  top: 78px;
  z-index: 6;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 12px 0;
  background: rgba(255,255,255,.94);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(12px);
}
.tool-button {
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: #fff;
  color: var(--ink);
  padding: 8px 12px;
  font: inherit;
  font-weight: 900;
  cursor: pointer;
}
.tool-button:hover {
  border-color: var(--accent);
  color: var(--accent-dark);
  background: var(--accent-wash);
}
.editor-blocks { display: grid; gap: 16px; padding-top: 16px; }
.editor-block {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fcfcfd;
  padding: 16px;
  box-shadow: 0 1px 2px rgba(15,23,42,.04);
}
.editor-block-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 12px;
}
.editor-block-header strong {
  font-family: var(--font-display);
  font-size: 1.25rem;
}
.editor-block-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}
.editor-block-actions label {
  display: flex;
  grid-template-columns: none;
  align-items: center;
  gap: 6px;
  font-size: .86rem;
}
.editor-block-actions select,
.editor-block-actions input {
  width: auto;
  min-width: 80px;
  padding: 7px 9px;
}
.delete-toggle { color: var(--danger); }
.delete-toggle input { width: auto; }
.editor-block-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.editor-block-grid .field-wide { grid-column: 1 / -1; }
.office-textarea {
  min-height: 220px;
  font-family: var(--font-mono);
  line-height: 1.7;
  resize: vertical;
}
.rich-source-hidden {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  opacity: 0;
}
.rich-text-field > span {
  display: block;
  margin-bottom: 8px;
  font-weight: 900;
}
.rich-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  padding: 9px;
  border: 1px solid var(--line);
  border-bottom: 0;
  border-radius: 8px 8px 0 0;
  background: linear-gradient(180deg, #fff, #f8fafc);
}
.toolbar-group {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 5px;
  align-items: center;
  padding: 5px;
  border: 1px solid #edf2f7;
  border-radius: 8px;
  background: rgba(248,250,252,.82);
}
.rich-toolbar select,
.rich-toolbar button {
  width: auto;
  min-height: 34px;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  background: #fff;
  color: var(--ink);
  padding: 6px 9px;
  font: inherit;
  font-size: .84rem;
  font-weight: 800;
  cursor: pointer;
}
.rich-toolbar select { min-width: 140px; }
.rich-toolbar .rich-font { min-width: 126px; }
.rich-toolbar .rich-size { min-width: 70px; }
.rich-toolbar .rich-bullet-style { min-width: 126px; }
.rich-toolbar .rich-list-style { min-width: 112px; }
.color-tool {
  display: inline-flex;
  grid-template-columns: none;
  align-items: center;
  gap: 6px;
  font-size: .78rem;
  white-space: nowrap;
}
.color-tool input[type="color"] {
  width: 34px;
  height: 28px;
  min-height: 28px;
  padding: 2px;
  border-radius: 7px;
}
.rich-toolbar button:hover,
.rich-toolbar select:hover {
  border-color: var(--brand-light);
  background: var(--brand-wash);
  color: var(--brand-dark);
}
.formula-panel {
  flex: 1 0 100%;
  display: grid;
  gap: 12px;
  margin-top: 4px;
  padding: 12px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 16px 36px rgba(15,23,42,.10);
}
.formula-panel-header {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
}
.formula-controls {
  display: grid;
  grid-template-columns: minmax(130px, .28fr) minmax(260px, 1fr);
  gap: 10px;
}
.formula-controls label {
  display: grid;
  gap: 6px;
  font-size: .82rem;
  font-weight: 900;
  color: var(--ink-2);
}
.formula-code textarea,
.formula-input {
  width: 100%;
  min-height: 112px;
  padding: 10px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  font-family: var(--font-mono);
  font-size: .93rem;
  line-height: 1.55;
  resize: vertical;
}
.formula-template-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.formula-template-grid button {
  min-height: 32px;
  font-size: .78rem;
}
.formula-preview {
  min-height: 76px;
  padding: 14px;
  border: 1px dashed var(--line-strong);
  border-radius: 8px;
  background: #f8fafc;
  overflow-x: auto;
  color: var(--ink);
}
.formula-actions {
  display: flex;
  justify-content: flex-end;
}
.rich-editor-surface {
  min-height: 360px;
  padding: clamp(18px, 3vw, 34px);
  border: 1px solid var(--line);
  border-radius: 0 0 8px 8px;
  background: #fff;
  box-shadow: inset 0 0 0 1px rgba(15,23,42,.02);
  font-family: var(--font-sans);
  font-size: 1.02rem;
  line-height: 1.75;
  overflow-wrap: anywhere;
}
.rich-editor-surface:focus {
  outline: 3px solid rgba(59,130,246,.22);
  outline-offset: 2px;
}
.rich-editor-surface h1,
.rich-editor-surface h2,
.rich-editor-surface h3,
.rich-output h1,
.rich-output h2,
.rich-output h3 {
  margin: 1rem 0 .6rem;
  font-family: var(--font-display);
  font-weight: 900;
}
.rich-editor-surface h1, .rich-output h1 { font-size: 2.15rem; }
.rich-editor-surface h2, .rich-output h2 { font-size: 1.65rem; }
.rich-editor-surface h3, .rich-output h3 { font-size: 1.28rem; color: var(--brand-dark); }
.rich-editor-surface p,
.rich-output p { margin: 0 0 .95rem; }
.rich-editor-surface ul,
.rich-editor-surface ol,
.rich-output ul,
.rich-output ol {
  margin: .75rem 0 1rem 1.35rem;
  padding-left: 1rem;
}
.rich-editor-surface ul[data-list-marker],
.rich-output ul[data-list-marker] {
  list-style: none;
  padding-left: 1.45rem;
}
.rich-editor-surface ul[data-list-marker] > li,
.rich-output ul[data-list-marker] > li {
  position: relative;
}
.rich-editor-surface ul[data-list-marker] > li::before,
.rich-output ul[data-list-marker] > li::before {
  position: absolute;
  left: -1.35rem;
  width: 1rem;
  color: var(--brand);
  font-weight: 900;
  text-align: center;
}
.rich-editor-surface ul[data-list-marker="check"] > li::before,
.rich-output ul[data-list-marker="check"] > li::before { content: "\2713"; }
.rich-editor-surface ul[data-list-marker="arrow"] > li::before,
.rich-output ul[data-list-marker="arrow"] > li::before { content: "\2192"; }
.rich-editor-surface ul[data-list-marker="star"] > li::before,
.rich-output ul[data-list-marker="star"] > li::before { content: "\2605"; }
.rich-editor-surface ul[data-list-marker="diamond"] > li::before,
.rich-output ul[data-list-marker="diamond"] > li::before { content: "\25C6"; }
.rich-editor-surface ul[data-list-marker="dash"] > li::before,
.rich-output ul[data-list-marker="dash"] > li::before { content: "-"; }
.rich-editor-surface blockquote,
.rich-output blockquote {
  margin: 1rem 0;
  padding: .8rem 1rem;
  border-left: 4px solid var(--accent);
  background: var(--accent-wash);
  color: var(--ink-2);
}
.rich-editor-surface pre,
.rich-output pre {
  padding: 1rem;
  border-radius: 8px;
  background: #0f172a;
  color: #bfdbfe;
  overflow-x: auto;
}
.rich-editor-surface code,
.rich-output code {
  font-family: var(--font-mono);
}
.rich-editor-surface table,
.rich-output table {
  width: 100%;
  margin: 1rem 0;
  border-collapse: collapse;
}
.rich-editor-surface th,
.rich-editor-surface td,
.rich-output th,
.rich-output td {
  border: 1px solid var(--line-strong);
  padding: .65rem .75rem;
  vertical-align: top;
}
.rich-editor-surface th,
.rich-output th {
  background: var(--brand-wash);
  color: var(--brand-dark);
}
.rich-editor-surface .active-editor-cell {
  outline: 3px solid rgba(249,115,22,.45);
  outline-offset: -3px;
  background-image: linear-gradient(rgba(249,115,22,.08), rgba(249,115,22,.08));
}
@media (max-width: 720px) {
  .formula-controls {
    grid-template-columns: 1fr;
  }
  .formula-actions {
    justify-content: stretch;
  }
  .formula-actions button {
    width: 100%;
  }
}
.current-assets {
  display: grid;
  gap: 4px;
  margin-top: 12px;
  color: var(--muted);
  font-size: .86rem;
}
.editor-sidebar {
  position: sticky;
  top: 96px;
  display: grid;
  gap: 14px;
}
.editor-sidebar code {
  display: block;
  margin-top: 8px;
  padding: 9px 10px;
  border-radius: 8px;
  background: #0f172a;
  color: #bfdbfe;
  font-family: var(--font-mono);
  white-space: normal;
}
.chapter-editor-list {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}
.chapter-editor-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}
audio { width: 100%; }

@media (max-width: 900px) {
  .contact-strip, .topbar-inner, .section-heading, .split, .editor-heading, .editor-block-header, .chapter-editor-row { align-items: flex-start; flex-direction: column; }
  .hero, .course-hero, .learning-layout, .footer, .chapter-editor, .editor-meta, .editor-block-grid { grid-template-columns: 1fr; }
  .hero { min-height: auto; }
  .enroll-panel, .chapter-nav, .editor-sidebar, .office-toolbar { position: static; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: .01ms !important;
  }
}
