:root {
  --brand-primary: #f37435;
  --brand-primary-deep: #d95e20;
  --brand-secondary: #632942;
  --brand-secondary-deep: #4a1b31;
  --surface: #ffffff;
  --surface-soft: #f9fafb;
  --line: #e5e7eb;
  --ink: #182230;
  --ink-soft: #667085;
  --success: #1d8c5f;
  --warning: #c77416;
  --danger: #b23a3a;
  --radius-xl: 12px;
  --radius-lg: 10px;
  --radius-md: 8px;
  --radius-sm: 8px;
  --shadow-lg: 0 10px 28px rgba(16, 24, 40, 0.08);
  --shadow-md: 0 4px 16px rgba(16, 24, 40, 0.08);
  --font-body: "Inter", "Manrope", "Segoe UI", sans-serif;
  --font-heading: "Inter", "Manrope", "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-body);
  color: var(--ink);
  background: #f7f8fa;
}

img {
  max-width: 100%;
  display: block;
}

button,
input,
select,
textarea {
  font: inherit;
}

a {
  color: inherit;
}

.app-shell {
  width: min(1280px, calc(100% - 32px));
  margin: 0 auto;
  padding: 18px 0 36px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background: var(--surface);
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.05);
}

.topbar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.topbar-brand img {
  width: min(142px, 40vw);
  height: auto;
}

.brand-copy {
  display: grid;
  gap: 2px;
}

.brand-copy strong {
  font-family: var(--font-heading);
  font-size: 0.92rem;
  letter-spacing: 0;
}

.brand-copy span,
.topbar-actions {
  color: var(--ink-soft);
  font-size: 0.93rem;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.shell-gap {
  display: grid;
  gap: 18px;
  margin-top: 16px;
}

.hero-card,
.section-card,
.workspace-card,
.summary-card,
.course-card,
.empty-state,
.login-card,
.report-card,
.stat-card {
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background: var(--surface);
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.05);
}

.hero-card {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(280px, 0.9fr);
  gap: 0;
  overflow: hidden;
}

.hero-body {
  padding: 28px 30px;
}

.hero-body h1,
.page-title,
.section-title,
.course-card h3,
.report-card h3,
.workspace-card h2,
.login-card h1,
.summary-card strong {
  font-family: var(--font-heading);
  letter-spacing: 0;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-transform: uppercase;
  font-size: 0.73rem;
  letter-spacing: 0.08em;
  font-weight: 700;
  color: var(--brand-primary);
}

.hero-body h1,
.login-card h1 {
  margin: 14px 0 12px;
  font-size: clamp(1.8rem, 3vw, 2.6rem);
  line-height: 1.08;
}

.hero-body p,
.login-card p,
.section-lead,
.muted {
  color: var(--ink-soft);
  line-height: 1.6;
}

.hero-side {
  position: relative;
  padding: 24px;
  background: #fff7f1;
  border-left: 1px solid var(--line);
  color: var(--ink);
}

.hero-side::after {
  display: none;
}

.hero-side h2 {
  margin: 0 0 12px;
  font-family: var(--font-heading);
  font-size: 1.42rem;
}

.hero-side p {
  margin: 0 0 20px;
  color: var(--ink-soft);
}

.metric-stack {
  display: grid;
  gap: 12px;
}

.metric-pill {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  background: #ffffff;
  border: 1px solid var(--line);
}

.metric-pill strong {
  font-size: 1.32rem;
  font-family: var(--font-heading);
  color: var(--brand-primary);
}

.login-shell {
  display: grid;
  place-items: center;
  min-height: calc(100vh - 40px);
}

.login-card {
  width: min(560px, 100%);
  overflow: hidden;
}

.login-header {
  padding: 24px 26px 16px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}

.login-header img {
  width: min(168px, 48vw);
}

.login-body {
  padding: 24px 26px 28px;
}

.auth-form,
.stack-form {
  display: grid;
  gap: 16px;
}

.field {
  display: grid;
  gap: 8px;
}

.field span,
.fieldset-title {
  font-size: 0.95rem;
  font-weight: 700;
}

input,
select,
textarea {
  width: 100%;
  padding: 12px 13px;
  border-radius: var(--radius-sm);
  border: 1px solid #d0d5dd;
  background: #ffffff;
  color: var(--ink);
  transition:
    border-color 120ms ease,
    box-shadow 120ms ease,
    transform 120ms ease;
}

textarea {
  min-height: 140px;
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: rgba(243, 116, 53, 0.8);
  box-shadow: 0 0 0 3px rgba(243, 116, 53, 0.12);
}

.button-row,
.chip-row,
.inline-row,
.toolbar-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.button-row.compact {
  gap: 8px;
  align-items: center;
}

button,
.button-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 14px;
  border: 0;
  border-radius: var(--radius-md);
  cursor: pointer;
  font-weight: 800;
  text-decoration: none;
  transition:
    transform 120ms ease,
    opacity 120ms ease,
    box-shadow 120ms ease;
}

button:hover,
.button-link:hover {
  transform: translateY(-1px);
}

button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}

.button-primary {
  color: #fff;
  background: var(--brand-primary);
  box-shadow: 0 6px 14px rgba(243, 116, 53, 0.24);
}

.button-secondary {
  color: var(--ink);
  background: #f2f4f7;
  border: 1px solid #eaecf0;
}

.button-ghost {
  color: var(--ink);
  background: #ffffff;
  border: 1px solid #d0d5dd;
}

.full-width {
  width: 100%;
}

.icon-button {
  min-width: 36px;
  min-height: 36px;
  padding: 0 10px;
}

.text-icon {
  color: var(--ink);
  background: #fff;
  border: 1px solid #d0d5dd;
  font-size: 0.82rem;
}

.button-danger {
  color: #fff;
  background: linear-gradient(135deg, #c64e4e, #8e2b2b);
}

.status-line {
  min-height: 24px;
  font-weight: 700;
  color: var(--ink-soft);
}

.status-line.success {
  color: var(--success);
}

.status-line.error {
  color: var(--danger);
}

.status-line.warning {
  color: var(--warning);
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 22px;
}

.span-12 {
  grid-column: span 12;
}

.span-8 {
  grid-column: span 8;
}

.span-6 {
  grid-column: span 6;
}

.span-4 {
  grid-column: span 4;
}

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

.summary-card {
  padding: 16px;
  border-left: 3px solid var(--brand-primary);
}

.summary-card span {
  display: block;
  color: var(--ink-soft);
  font-size: 0.92rem;
}

.summary-card strong {
  display: block;
  margin-top: 8px;
  font-size: 1.75rem;
}

.section-card {
  padding: 20px;
}

.section-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 18px;
}

.page-title,
.section-title {
  margin: 0;
  font-size: 1.28rem;
}

.course-grid,
.template-grid,
.stats-grid,
.question-list,
.comments-list {
  display: grid;
  gap: 16px;
}

.course-card,
.report-card,
.workspace-card,
.stat-card {
  padding: 18px;
}

.course-card h3,
.report-card h3 {
  margin: 8px 0 10px;
  font-size: 1.1rem;
}

.course-meta,
.meta-list {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  color: var(--ink-soft);
  font-size: 0.92rem;
}

.chip-row {
  margin: 16px 0 0;
}

.chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid #eaecf0;
  background: #f9fafb;
  color: var(--ink-soft);
  font-size: 0.84rem;
  font-weight: 800;
}

.chip.primary {
  color: var(--brand-primary-deep);
  background: rgba(243, 116, 53, 0.1);
  border-color: rgba(243, 116, 53, 0.18);
}

.chip.orange {
  color: var(--brand-primary-deep);
  background: rgba(243, 116, 53, 0.12);
}

.chip.success {
  color: var(--success);
  background: rgba(29, 140, 95, 0.1);
}

.chip.warning {
  color: var(--warning);
  background: rgba(199, 116, 22, 0.1);
}

.chip.danger {
  color: var(--danger);
  background: rgba(178, 58, 58, 0.1);
}

.empty-state {
  padding: 34px 20px;
  text-align: center;
}

.empty-state h3 {
  margin: 0 0 8px;
  font-family: var(--font-heading);
}

.course-layout {
  display: grid;
  gap: 24px;
}

.detail-head {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(260px, 0.75fr);
  gap: 20px;
}

.detail-highlight {
  padding: 22px;
  border-radius: var(--radius-lg);
  background:
    linear-gradient(135deg, rgba(243, 116, 53, 0.12), rgba(99, 41, 66, 0.08)),
    var(--surface-soft);
  border: 1px solid rgba(243, 116, 53, 0.14);
}

.detail-score {
  display: grid;
  gap: 10px;
  padding: 22px;
  border-radius: var(--radius-lg);
  background:
    linear-gradient(180deg, rgba(99, 41, 66, 0.98), rgba(243, 116, 53, 0.94));
  color: #fff7f2;
}

.detail-score strong {
  font-family: var(--font-heading);
  font-size: 2.6rem;
}

.question-card {
  padding: 18px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(99, 41, 66, 0.1);
  background: rgba(255, 255, 255, 0.86);
}

.question-card h4 {
  margin: 0 0 12px;
  font-size: 1rem;
}

.option-list,
.rating-list {
  display: grid;
  gap: 10px;
}

.option-item,
.rating-item,
.checkbox-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  color: var(--ink);
}

.option-item input,
.rating-item input,
.checkbox-item input {
  width: auto;
  margin-top: 2px;
}

.workspace-card {
  padding: 24px;
}

.workspace-card h2 {
  margin: 8px 0 10px;
  font-size: 1.7rem;
}

.mentor-layout {
  display: grid;
  gap: 24px;
}

.mentor-forms {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px;
}

.fieldset-box {
  padding: 18px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(99, 41, 66, 0.08);
  background: rgba(255, 250, 246, 0.86);
}

.fieldset-box + .fieldset-box {
  margin-top: 14px;
}

.editor-step-nav {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  padding: 6px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(99, 41, 66, 0.1);
  background: #f7f7f8;
}

.editor-step-button {
  min-height: 40px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #5d6675;
  cursor: pointer;
  font-weight: 800;
}

.editor-step-button.active {
  background: #fff;
  color: var(--brand-secondary);
  box-shadow: 0 8px 18px rgba(22, 27, 34, 0.08);
}

.editor-screen {
  display: none;
}

.editor-screen.active {
  display: grid;
  gap: 14px;
}

.checkbox-field {
  min-height: 100%;
  align-items: center;
}

.fieldset-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.fieldset-head h3 {
  margin: 0;
  font-family: var(--font-heading);
  font-size: 1.15rem;
}

.two-col,
.three-col,
.four-col {
  display: grid;
  gap: 14px;
}

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

.three-col {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.four-col {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.question-builder-card {
  padding: 16px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(99, 41, 66, 0.1);
  background: rgba(255, 255, 255, 0.92);
}

.content-section-list,
.content-item-list,
.slide-builder-list,
.course-content-outline,
.content-outline-items {
  display: grid;
  gap: 14px;
}

.content-section-card,
.content-item-card,
.content-slide-card,
.content-outline-section,
.content-outline-item {
  padding: 16px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(99, 41, 66, 0.1);
  background: #fff;
}

.content-section-card {
  display: grid;
  gap: 14px;
}

.content-builder-layout {
  display: grid;
  grid-template-columns: 1fr;
  min-height: 0;
  gap: 16px;
  align-items: start;
}

.content-module-sidebar,
.content-item-sidebar,
.content-author-panel,
.content-item-author,
.slide-author-shell {
  min-width: 0;
}

.content-module-sidebar,
.content-item-sidebar {
  position: sticky;
  top: 14px;
  display: grid;
  gap: 12px;
  max-height: calc(100vh - 150px);
  overflow: auto;
  padding: 12px;
  border: 1px solid rgba(99, 41, 66, 0.1);
  border-radius: var(--radius-md);
  background: #fafafa;
}

.content-toggle-panel.collapsed {
  background: #fff;
}

.content-toggle-panel.collapsed .content-pane-header {
  align-items: stretch;
  flex-direction: column;
}

.content-toggle-panel.collapsed .content-pane-header button {
  width: 100%;
}

.content-module-overview {
  display: grid;
  gap: 16px;
}

.module-overview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 14px;
}

.module-overview-card {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid rgba(99, 41, 66, 0.1);
  border-radius: var(--radius-md);
  background: #fff;
}

.module-overview-card:hover {
  border-color: rgba(243, 116, 53, 0.38);
}

.module-overview-main {
  display: grid;
  justify-items: start;
  gap: 8px;
  min-height: 140px;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
}

.module-overview-main span,
.module-overview-meta span {
  color: var(--ink-soft);
  font-size: 0.76rem;
  font-weight: 800;
  text-transform: uppercase;
}

.module-overview-main strong {
  font-family: var(--font-heading);
  font-size: 1.05rem;
}

.module-overview-main small {
  color: var(--ink-soft);
  line-height: 1.45;
}

.module-overview-meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: auto;
}

.module-overview-meta span {
  padding: 5px 8px;
  border-radius: 999px;
  background: rgba(99, 41, 66, 0.06);
}

.content-pane-header,
.content-author-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.content-pane-header > div {
  display: grid;
  gap: 2px;
}

.content-pane-header span,
.collapsed-picker-summary span,
.slide-preview-topline span {
  color: var(--ink-soft);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.content-module-list,
.content-item-picker-list,
.content-author-panel,
.selected-content-author,
.content-item-author,
.slide-author-shell {
  display: grid;
  gap: 14px;
}

.content-module-picker,
.content-item-picker,
.slide-rail-item {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid rgba(99, 41, 66, 0.1);
  border-radius: var(--radius-md);
  background: #fff;
}

.content-module-picker.active,
.content-item-picker.active,
.slide-rail-item.active {
  border-color: rgba(243, 116, 53, 0.55);
  box-shadow: inset 3px 0 0 var(--brand-primary);
}

.content-module-picker > button,
.content-item-picker > button,
.slide-rail-item > button {
  display: grid;
  justify-items: start;
  gap: 4px;
  width: 100%;
  min-height: 0;
  padding: 0;
  border: 0;
  color: inherit;
  background: transparent;
  text-align: left;
}

.content-module-picker span,
.content-item-picker span,
.slide-rail-item span,
.content-module-picker small,
.content-item-picker small,
.slide-rail-item small {
  color: var(--ink-soft);
  font-size: 0.74rem;
  font-weight: 800;
  text-transform: uppercase;
}

.content-module-picker strong,
.content-item-picker strong,
.collapsed-picker-summary strong,
.slide-rail-item strong {
  font-size: 0.92rem;
  line-height: 1.25;
}

.collapsed-picker-summary {
  display: grid;
  gap: 4px;
  padding: 12px;
  border: 1px solid rgba(99, 41, 66, 0.1);
  border-radius: var(--radius-md);
  background: rgba(243, 116, 53, 0.06);
}

.collapsed-picker-summary small {
  color: var(--ink-soft);
  font-size: 0.74rem;
  font-weight: 800;
  text-transform: uppercase;
}

.content-picker-actions,
.slide-rail-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.content-picker-actions .button-ghost,
.slide-rail-actions .button-ghost {
  min-height: 32px;
  padding: 0 10px;
  font-size: 0.78rem;
}

.selected-content-author,
.content-item-card.selected {
  padding: 16px;
  border: 1px solid rgba(99, 41, 66, 0.1);
  border-radius: var(--radius-md);
  background: #fff;
}

.selected-content-author h4,
.content-item-card.selected h5 {
  margin: 0;
  font-family: var(--font-heading);
}

.content-editor-grid {
  display: grid;
  grid-template-columns: minmax(190px, 250px) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.content-editor-grid.contents-collapsed {
  grid-template-columns: minmax(150px, 170px) minmax(0, 1fr);
}

.slide-author-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(320px, 0.92fr);
  gap: 16px;
  align-items: stretch;
}

.slide-stage-preview {
  min-height: 520px;
}

.slide-preview-topline {
  display: flex;
  justify-content: flex-end;
}

.empty-slide-preview {
  display: grid;
  place-items: center;
  min-height: 220px;
  border: 1px dashed #d0d5dd;
  border-radius: var(--radius-md);
  color: var(--ink-soft);
  font-weight: 700;
  text-align: center;
}

.custom-html-frame,
.custom-html-frame iframe {
  width: 100%;
  min-height: 360px;
}

.custom-html-frame iframe {
  border: 1px solid rgba(99, 41, 66, 0.12);
  border-radius: var(--radius-md);
  background: #fff;
}

.rich-content {
  line-height: 1.65;
}

.rich-content :first-child {
  margin-top: 0;
}

.rich-content :last-child {
  margin-bottom: 0;
}

.rich-editor-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 8px;
  border: 1px solid #d0d5dd;
  border-radius: var(--radius-md) var(--radius-md) 0 0;
  background: #f9fafb;
}

.rich-editor-surface {
  min-height: 220px;
  max-height: 420px;
  overflow: auto;
  padding: 14px;
  border: 1px solid #d0d5dd;
  border-top: 0;
  border-radius: 0 0 var(--radius-md) var(--radius-md);
  background: #fff;
  line-height: 1.6;
}

.rich-editor-surface:focus {
  outline: none;
  border-color: rgba(243, 116, 53, 0.8);
  box-shadow: 0 0 0 3px rgba(243, 116, 53, 0.12);
}

.code-textarea {
  min-height: 300px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 0.9rem;
}

.slide-rail {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 10px;
}

.pdf-import-field small {
  color: var(--ink-soft);
  font-size: 0.82rem;
}

.content-item-card,
.content-slide-card,
.content-outline-item {
  background: #fafafa;
}

.content-slide-card {
  border-style: dashed;
}

.content-type-grid,
.publish-summary-grid {
  display: grid;
  grid-template-columns: 1.1fr 1.5fr 0.8fr 0.9fr;
  gap: 14px;
}

.publish-summary-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.metric-tile {
  padding: 14px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(99, 41, 66, 0.1);
  background: #fff;
}

.metric-tile span {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.metric-tile strong {
  display: block;
  margin-top: 4px;
  font-family: var(--font-heading);
  font-size: 1.7rem;
}

.content-outline-head {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 14px;
}

.content-step {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
  border-radius: 50%;
  background: var(--brand-primary);
  color: #fff;
  font-weight: 900;
}

.content-outline-head h3,
.content-outline-item h4 {
  margin: 0;
}

.content-outline-head p,
.content-outline-item p {
  margin: 6px 0 0;
  color: var(--muted);
}

.content-item-meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.content-item-meta span {
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(243, 116, 53, 0.1);
  color: var(--brand-secondary);
  font-size: 0.76rem;
  font-weight: 800;
}

.content-body {
  margin-top: 12px;
  padding: 14px;
  border-radius: 8px;
  background: #fff;
  color: #27303f;
  line-height: 1.6;
}

.progress-bar {
  width: 100%;
  height: 8px;
  margin-top: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(99, 41, 66, 0.1);
}

.progress-bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--brand-primary), var(--brand-secondary));
}

.content-player {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto auto;
  gap: 16px;
  min-height: 0;
}

.content-page-shell {
  display: grid;
  grid-template-columns: minmax(260px, 340px) minmax(0, 1fr);
  gap: 22px;
  align-items: start;
  height: calc(100vh - 132px);
  min-height: 560px;
  overflow: hidden;
}

.content-page-aside {
  position: sticky;
  top: 18px;
  display: grid;
  gap: 14px;
  padding: 18px;
  border: 1px solid rgba(99, 41, 66, 0.1);
  border-radius: var(--radius-md);
  background: #fff;
  max-height: 100%;
  overflow: auto;
}

.content-page-aside h1 {
  margin: 0;
  font-family: var(--font-heading);
  font-size: 1.35rem;
}

.content-page-aside p {
  margin: 0;
  color: var(--muted);
}

.content-page-list {
  display: grid;
  gap: 8px;
}

.content-page-list a {
  display: grid;
  gap: 3px;
  padding: 10px 12px;
  border: 1px solid rgba(99, 41, 66, 0.08);
  border-radius: 8px;
  background: #fafafa;
  color: inherit;
  text-decoration: none;
}

.content-page-list a span {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
  text-transform: uppercase;
}

.content-page-list a strong {
  font-size: 0.92rem;
}

.content-page-list a.active {
  border-color: rgba(243, 116, 53, 0.38);
  background: rgba(243, 116, 53, 0.08);
}

.content-page-list a.disabled {
  opacity: 0.48;
  pointer-events: none;
}

.content-page-nav {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.slide-stage {
  display: grid;
  gap: 12px;
  min-height: 0;
  padding: 22px;
  border: 1px solid rgba(99, 41, 66, 0.1);
  border-radius: var(--radius-md);
  background: #fff;
  overflow: auto;
}

.slide-stage h3 {
  margin: 0 0 14px;
  font-family: var(--font-heading);
}

.embedded-frame {
  width: 100%;
  height: min(62vh, 620px);
  min-height: 340px;
  overflow: hidden;
  border-radius: 8px;
  border: 1px solid rgba(99, 41, 66, 0.12);
  background: #111827;
}

.embedded-frame iframe {
  width: 100%;
  height: 100%;
  border: 0;
}

.slide-image {
  width: 100%;
  max-height: 58vh;
  object-fit: contain;
  border-radius: 8px;
  background: #f3f4f6;
}

.question-builder-card h4 {
  margin: 0 0 12px;
  font-family: var(--font-heading);
  font-size: 1rem;
}

.divider {
  height: 1px;
  background: rgba(99, 41, 66, 0.08);
  margin: 18px 0;
}

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

.stat-card strong {
  display: block;
  margin-top: 10px;
  font-family: var(--font-heading);
  font-size: 1.9rem;
}

.comment-card {
  padding: 16px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(99, 41, 66, 0.08);
  background: rgba(255, 255, 255, 0.82);
}

.comment-card p {
  margin: 8px 0 0;
}

.helper {
  font-size: 0.88rem;
  color: var(--ink-soft);
}

.inline-note {
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  background: rgba(243, 116, 53, 0.08);
  border: 1px solid rgba(243, 116, 53, 0.14);
  color: var(--brand-primary-deep);
  font-weight: 700;
}

.loading-card {
  padding: 34px 24px;
  text-align: center;
  border-radius: var(--radius-xl);
  background: rgba(255, 255, 255, 0.84);
  border: 1px dashed rgba(99, 41, 66, 0.16);
}

.loading-card strong {
  font-family: var(--font-heading);
}

.control-shell {
  display: grid;
  gap: 18px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background: var(--surface);
  box-shadow: var(--shadow-lg);
}

.admin-shell {
  background: rgba(255, 255, 255, 0.97);
}

.control-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.control-chips {
  margin: 0;
}

.tab-bar,
.filter-bar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.tab-button,
.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 0 16px;
  border: 1px solid rgba(99, 41, 66, 0.12);
  border-radius: 14px;
  background: rgba(99, 41, 66, 0.06);
  color: var(--brand-secondary);
  cursor: pointer;
  font-weight: 800;
}

.tab-button.active,
.filter-chip.active {
  color: #fff;
  background: linear-gradient(135deg, var(--brand-primary), var(--brand-secondary));
  box-shadow: 0 14px 28px rgba(99, 41, 66, 0.16);
}

.filter-chip strong {
  font-family: var(--font-heading);
}

.panel-grid,
.section-stack {
  display: grid;
  gap: 18px;
}

.panel-grid {
  grid-template-columns: minmax(340px, 420px) minmax(0, 1fr);
}

.compact-panel {
  padding: 20px;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(99, 41, 66, 0.08);
  background: rgba(255, 255, 255, 0.92);
}

.compact-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.compact-header h3,
.compact-header h4,
.compact-header h5,
.compact-header h6 {
  margin: 0;
  font-family: var(--font-heading);
}

.table-shell {
  overflow-x: auto;
  border: 1px solid rgba(99, 41, 66, 0.08);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.96);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 860px;
}

.data-table th,
.data-table td {
  padding: 14px 16px;
  border-bottom: 1px solid rgba(99, 41, 66, 0.08);
  vertical-align: top;
  text-align: left;
}

.data-table th {
  position: sticky;
  top: 0;
  background: rgba(248, 238, 244, 0.92);
  color: var(--brand-secondary);
  font-size: 0.84rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.data-table tbody tr:last-child td {
  border-bottom: 0;
}

.data-table small {
  color: var(--ink-soft);
}

.table-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.table-actions button,
.table-actions .button-link {
  min-height: 40px;
  padding: 0 14px;
  font-size: 0.88rem;
}

.table-empty {
  padding: 24px;
}

@media (max-width: 1080px) {
  .hero-card,
  .detail-head,
  .mentor-forms,
  .panel-grid {
    grid-template-columns: 1fr;
  }

  .control-header {
    flex-direction: column;
  }

  .summary-strip,
  .report-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .slide-author-grid,
  .content-editor-grid {
    grid-template-columns: 1fr;
  }

  .span-8,
  .span-6,
  .span-4 {
    grid-column: span 12;
  }
}

@media (max-width: 760px) {
  .app-shell {
    width: min(100% - 18px, 1220px);
    padding-top: 14px;
  }

  .topbar {
    border-radius: var(--radius-xl);
    padding: 14px;
    align-items: flex-start;
    flex-direction: column;
  }

  .hero-body,
  .hero-side,
  .section-card,
  .workspace-card,
  .course-card,
  .report-card,
  .login-body,
  .login-header {
    padding: 20px;
  }

  .summary-strip,
  .two-col,
  .three-col,
  .four-col,
  .report-grid,
  .editor-step-nav,
  .content-type-grid,
  .publish-summary-grid,
  .content-page-shell,
  .content-builder-layout,
  .content-editor-grid,
  .slide-author-grid {
    grid-template-columns: 1fr;
  }

  .content-page-aside,
  .content-module-sidebar,
  .content-item-sidebar {
    position: static;
    max-height: none;
  }

  .content-page-shell {
    height: auto;
    min-height: 0;
    overflow: visible;
  }

  .embedded-frame {
    height: auto;
    min-height: 0;
    aspect-ratio: 16 / 9;
  }

  .button-row,
  .toolbar-row,
  .inline-row,
  .table-actions,
  .content-page-nav {
    flex-direction: column;
  }

  button,
  .button-link,
  .tab-button,
  .editor-step-button,
  .filter-chip {
    width: 100%;
  }

  .hero-body h1,
  .login-card h1 {
    font-size: 2rem;
  }

  .data-table {
    min-width: 720px;
  }
}
