.module-video-workspace[hidden],
.module-whiteboard-workspace[hidden] {
  display: none !important;
}

.module-panel-header {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--line);
  padding: 18px 20px;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(12px);
}

.module-panel-header h2 {
  margin: 8px 0 0;
  font-size: clamp(1.35rem, 3vw, 2rem);
}

.module-panel-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.module-panel-body {
  display: grid;
  grid-template-columns: minmax(240px, 0.88fr) minmax(0, 1.4fr);
  gap: 16px;
  overflow: auto;
  padding: 18px 20px 20px;
}

.module-info-panel,
.module-actions-panel,
.module-video-workspace {
  border: 1px solid var(--panel-line);
  border-radius: 22px;
  background: #fff;
  box-shadow: var(--shadow-card);
}

.module-info-panel {
  align-self: start;
  padding: 18px;
}

.module-info-panel p:last-child {
  margin-bottom: 0;
  color: var(--text);
  font-size: 1.02rem;
  font-weight: 820;
}

.module-actions-panel {
  display: grid;
  gap: 14px;
  padding: 18px;
}

.module-actions-heading h3 {
  margin-bottom: 0;
}

.module-action-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.module-action-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 3px 12px;
  align-items: center;
  min-height: 78px;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 13px;
  text-align: left;
  color: var(--text);
  background: #fff;
  box-shadow: 0 10px 22px rgba(41, 69, 112, 0.08);
  transition:
    border-color 160ms ease,
    box-shadow 160ms ease,
    transform 160ms ease;
}

button.module-action-card {
  font: inherit;
  cursor: pointer;
}

a.module-action-card:hover,
button.module-action-card:hover {
  border-color: rgba(24, 184, 216, 0.42);
  box-shadow: 0 16px 32px rgba(41, 69, 112, 0.13);
  transform: translateY(-1px);
}

.module-action-card:focus-visible {
  outline: 3px solid rgba(24, 184, 216, 0.2);
  outline-offset: 2px;
}

.module-action-icon {
  display: grid;
  grid-row: span 2;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 15px;
  background: var(--accent-blue-soft);
  color: #2367c7;
}

.module-action-icon .ui-icon {
  width: 21px;
  height: 21px;
}

.module-action-card strong,
.module-action-card small {
  min-width: 0;
}

.module-action-card strong {
  font-size: 0.98rem;
}

.module-action-card small {
  color: var(--muted);
  font-weight: 850;
}

.module-action-video .module-action-icon {
  background: var(--accent-coral-soft);
  color: #a73c2f;
}

.module-action-whiteboard .module-action-icon {
  background: var(--brand-yellow-soft);
  color: #7a5900;
}

.module-action-card.is-reference {
  background: #f8fafc;
}

.module-action-card.is-disabled {
  color: #7d8896;
  background: #f2f6fa;
}

.module-action-card.is-disabled .module-action-icon {
  background: #e9eef5;
  color: #8a96a6;
}

.module-video-workspace {
  grid-column: 1 / -1;
  overflow: hidden;
}

.module-video-header,
.whiteboard-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border-bottom: 1px solid var(--line);
  padding: 14px 16px;
}

.module-video-header h3,
.whiteboard-header h3 {
  margin-bottom: 0;
}

.module-video-workspace iframe {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  border: 0;
  background: #0f172a;
}

.module-panel-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.module-workspace-page {
  display: grid;
  width: min(100%, 1500px);
  min-height: calc(100vh - 56px);
  margin: 0 auto;
  gap: 14px;
}

.module-workspace-page.is-focus-mode {
  width: min(100%, 1680px);
  min-height: calc(100vh - 28px);
  gap: 10px;
}

.module-workspace-header {
  display: grid;
  grid-template-columns: minmax(0, 0.92fr) minmax(360px, 1.08fr);
  gap: 18px;
  border: 1px solid var(--panel-line);
  border-radius: var(--radius-panel);
  padding: clamp(16px, 2.2vw, 24px);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(239, 249, 255, 0.95)),
    var(--surface);
  box-shadow: var(--shadow-panel);
}

.module-workspace-page.is-focus-mode .module-workspace-header {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  border-radius: 22px;
  padding: 10px 14px;
}

.module-workspace-title {
  display: grid;
  align-content: start;
  justify-items: start;
  gap: 10px;
  min-width: 0;
}

.module-sibling-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.module-sibling-link {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  min-height: 38px;
  border: 1px solid rgba(63, 140, 255, 0.16);
  border-radius: 999px;
  padding: 0 12px;
  color: var(--brand-cyan-strong);
  background: rgba(231, 249, 255, 0.82);
  font-size: 0.86rem;
  font-weight: 950;
  text-decoration: none;
  transition:
    border-color 160ms ease,
    box-shadow 160ms ease,
    transform 160ms ease;
}

.module-sibling-link:hover {
  border-color: rgba(24, 184, 216, 0.38);
  box-shadow: 0 10px 22px rgba(24, 184, 216, 0.14);
  transform: translateY(-1px);
}

.module-sibling-link:focus-visible {
  outline: 3px solid rgba(24, 184, 216, 0.28);
  outline-offset: 2px;
}

.module-sibling-link .ui-icon {
  width: 16px;
  height: 16px;
}

.module-sibling-link.is-next {
  color: var(--brand-navy);
  background: rgba(255, 244, 188, 0.82);
}

.module-workspace-page.is-focus-mode .module-workspace-title {
  grid-template-columns: auto auto minmax(0, 1fr);
  align-items: center;
  gap: 8px 10px;
}

.module-workspace-title h1 {
  margin: 0;
  font-size: clamp(1.55rem, 3vw, 2.35rem);
}

.module-workspace-page.is-focus-mode .module-workspace-title h1 {
  font-size: clamp(1.08rem, 1.6vw, 1.42rem);
}

.module-workspace-title p {
  max-width: 920px;
  margin: 0;
  color: var(--muted);
  font-weight: 780;
}

.module-workspace-page.is-focus-mode .module-workspace-title > p {
  display: none;
}

.module-workspace-page.is-focus-mode .module-workspace-title .back-link {
  min-height: 34px;
  padding-inline: 11px;
  font-size: 0.82rem;
}

.module-workspace-page.is-focus-mode .module-sibling-nav {
  grid-column: 1 / -1;
  gap: 6px;
}

.module-workspace-page.is-focus-mode .module-sibling-link {
  min-height: 34px;
  padding-inline: 10px;
  font-size: 0.8rem;
}

.module-workspace-page.is-focus-mode .module-panel-meta {
  display: none;
}

.module-workspace-page.is-focus-mode .module-number,
.module-workspace-page.is-focus-mode .review-badge {
  min-height: 24px;
  padding-inline: 8px;
  font-size: 0.7rem;
}

.module-workspace-actions {
  display: grid;
  gap: 10px;
  align-content: start;
}

.module-workspace-page.is-focus-mode .module-workspace-actions {
  align-content: center;
  gap: 6px;
}

.module-workspace-page.is-focus-mode .workspace-action-group.is-external-resources,
.module-workspace-page.is-focus-mode .workspace-resource-action:not(.focus-mode-button):not([data-workspace-fullscreen]) {
  display: none;
}

.workspace-action-group {
  display: grid;
  gap: 7px;
  min-width: 0;
}

.workspace-action-group p {
  margin: 0;
  color: var(--brand-cyan-strong);
  font-size: 0.72rem;
  font-weight: 1000;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.workspace-action-details {
  justify-items: start;
}

.workspace-action-details summary {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  min-height: 38px;
  border: 1px solid rgba(63, 140, 255, 0.16);
  border-radius: 999px;
  padding: 0 12px;
  color: var(--brand-cyan-strong);
  background: rgba(231, 249, 255, 0.82);
  font-size: 0.82rem;
  font-weight: 950;
  cursor: pointer;
  list-style: none;
  transition:
    border-color 160ms ease,
    box-shadow 160ms ease,
    transform 160ms ease,
    background 160ms ease;
}

.workspace-action-details summary::-webkit-details-marker {
  display: none;
}

.workspace-action-details summary:hover {
  border-color: rgba(24, 184, 216, 0.42);
  background: rgba(215, 246, 255, 0.95);
  box-shadow: 0 12px 22px rgba(24, 184, 216, 0.12);
  transform: translateY(-1px);
}

.workspace-action-details summary:focus-visible {
  outline: 3px solid rgba(24, 184, 216, 0.22);
  outline-offset: 2px;
}

.workspace-action-details[open] summary {
  color: var(--brand-navy);
  background: #fff;
  box-shadow: 0 10px 24px rgba(41, 69, 112, 0.1);
}

.workspace-action-details[open] .workspace-details-icon {
  transform: rotate(90deg);
}

.workspace-details-icon {
  width: 16px;
  height: 16px;
  transition: transform 160ms ease;
}

.workspace-action-details .workspace-action-row {
  margin-top: 8px;
}

.workspace-action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  min-width: 0;
}

.module-workspace-page.is-focus-mode .workspace-action-row {
  justify-content: flex-end;
}

.module-workspace-page.is-focus-mode .workspace-resource-action {
  min-height: 34px;
  padding-inline: 10px;
  font-size: 0.78rem;
}

.workspace-resource-action {
  min-height: 38px;
  padding-inline: 12px;
  font-size: 0.82rem;
}

.workspace-resource-action .ui-icon {
  width: 17px;
  height: 17px;
}

.workspace-resource-action.is-active {
  box-shadow:
    0 0 0 4px rgba(24, 184, 216, 0.14),
    0 14px 30px rgba(24, 184, 216, 0.22);
}

.workspace-action-empty {
  display: inline-flex;
  gap: 7px;
  align-items: center;
  min-height: 34px;
  border: 1px dashed var(--line);
  border-radius: 999px;
  padding: 0 11px;
  color: var(--muted);
  background: rgba(248, 251, 255, 0.78);
  font-size: 0.8rem;
  font-weight: 950;
}

.workspace-action-empty .ui-icon {
  width: 16px;
  height: 16px;
}

.focus-mode-button.is-active {
  background: linear-gradient(135deg, var(--brand-yellow), var(--accent-orange));
  color: var(--brand-navy);
  box-shadow: 0 12px 28px rgba(245, 158, 11, 0.22);
}

.assignment-panel {
  display: grid;
  gap: 16px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: var(--radius-panel);
  padding: clamp(16px, 2vw, 22px);
  background:
    radial-gradient(circle at 92% 8%, rgba(149, 244, 130, 0.16), transparent 24%),
    linear-gradient(135deg, #321197 0%, #2b1287 48%, #24106f 100%);
  color: #fff;
  box-shadow: 0 24px 60px rgba(36, 16, 111, 0.22), 0 1px 0 rgba(255, 255, 255, 0.18) inset;
  animation: panelRise 180ms ease both;
}

.assignment-panel[hidden] {
  display: none;
}

.assignment-panel-header {
  display: flex;
  gap: 14px;
  align-items: start;
  justify-content: space-between;
}

.assignment-panel-header h2,
.assignment-panel-header p {
  margin: 0;
}

.assignment-panel-header h2 {
  font-size: clamp(1.12rem, 2vw, 1.45rem);
  color: #fff;
}

.assignment-panel .eyebrow {
  color: var(--accent-green);
}

.assignment-panel-header p:not(.eyebrow) {
  margin-top: 4px;
  color: rgba(255, 255, 255, 0.78);
  font-weight: 800;
}

.assignment-loading,
.assignment-notice {
  display: grid;
  gap: 10px;
  justify-items: center;
  border: 1px solid rgba(255, 255, 255, 0.68);
  border-radius: 22px;
  padding: 22px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(246, 242, 255, 0.9));
  color: var(--text);
  box-shadow: 0 12px 30px rgba(36, 16, 111, 0.14);
  text-align: center;
}

.assignment-notice-icon {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: 18px;
  background: var(--brand-cyan-soft);
  color: #0b6678;
}

.assignment-notice h3,
.assignment-notice p,
.assignment-loading p {
  margin: 0;
}

.assignment-notice h3 {
  color: var(--text);
}

.assignment-notice p,
.assignment-loading p {
  max-width: 680px;
  color: var(--muted);
  font-weight: 800;
}

.assignment-form {
  display: grid;
  gap: 14px;
}

.assignment-module-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 10px;
  align-items: center;
  border: 1px solid rgba(255, 255, 255, 0.68);
  border-radius: 22px;
  padding: 14px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(246, 242, 255, 0.9));
  color: var(--text);
  box-shadow: 0 12px 30px rgba(36, 16, 111, 0.14);
}

.assignment-module-summary strong {
  flex-basis: 100%;
  color: var(--text);
  font-size: 1.05rem;
}

.assignment-module-summary p {
  width: 100%;
  margin: 0;
  color: var(--muted);
  font-weight: 800;
}

.assignment-field {
  display: grid;
  gap: 7px;
  color: #fff;
  font-weight: 950;
}

.assignment-student-picker[hidden] {
  display: none;
}

.assignment-target-picker small {
  color: var(--muted);
  font-weight: 700;
}

.assignment-field legend {
  padding: 0;
  color: #fff;
  font-weight: 950;
}

.assignment-field select,
.assignment-field input[type="date"],
.assignment-field textarea {
  width: 100%;
  border: 1px solid rgba(63, 140, 255, 0.18);
  border-radius: 18px;
  background: #fff;
  color: var(--text);
  font: inherit;
  font-weight: 800;
  box-shadow: 0 8px 20px rgba(31, 47, 79, 0.06);
}

.assignment-field select,
.assignment-field input[type="date"] {
  min-height: 46px;
  padding: 0 14px;
}

.assignment-field textarea {
  min-height: 92px;
  resize: vertical;
  padding: 13px 14px;
}

.assignment-field select:focus-visible,
.assignment-field input[type="date"]:focus-visible,
.assignment-field textarea:focus-visible {
  outline: 3px solid rgba(24, 184, 216, 0.28);
  outline-offset: 2px;
}

.assignment-student-picker {
  border: 1px solid rgba(255, 255, 255, 0.68);
  border-radius: 22px;
  margin: 0;
  padding: 14px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(246, 242, 255, 0.9));
  box-shadow: 0 12px 30px rgba(36, 16, 111, 0.14);
}

.assignment-student-picker legend {
  float: left;
  width: 100%;
  margin: 0 0 10px;
  padding: 0 4px;
  color: var(--text);
}

.assignment-student-picker legend + * {
  clear: both;
}

.assignment-picker-toolbar,
.assignment-picker-toolbar div {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.assignment-picker-toolbar {
  justify-content: space-between;
  border: 1px solid rgba(74, 47, 186, 0.14);
  border-radius: 18px;
  padding: 10px;
  background: rgba(255, 255, 255, 0.82);
}

.assignment-picker-toolbar [data-assignment-selected-count] {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  border-radius: 999px;
  padding: 0 12px;
  background: var(--brand-cyan-soft);
  color: var(--brand-cyan-strong);
  font-size: 0.84rem;
  font-weight: 1000;
}

.assignment-student-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
}

.assignment-student-option {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  min-height: 68px;
  border: 1px solid rgba(74, 47, 186, 0.14);
  border-radius: 18px;
  padding: 12px;
  background: #fff;
  color: var(--text);
  box-shadow: 0 8px 20px rgba(31, 47, 79, 0.05);
  cursor: pointer;
  transition:
    border-color 160ms ease,
    background 160ms ease,
    box-shadow 160ms ease;
}

.assignment-student-option:has(input:checked) {
  border-color: rgba(24, 184, 216, 0.44);
  background: var(--brand-cyan-soft);
  box-shadow: 0 12px 26px rgba(24, 184, 216, 0.12);
}

.assignment-student-option input {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  margin: 3px 0 0;
  accent-color: var(--brand-cyan-strong);
}

.assignment-student-option input:focus-visible {
  outline: 3px solid rgba(24, 184, 216, 0.28);
  outline-offset: 3px;
}

.assignment-student-option span {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.assignment-student-option strong,
.assignment-student-option small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.assignment-student-option strong {
  color: var(--text);
}

.assignment-student-option small {
  color: var(--muted);
  font-weight: 800;
}

.assignment-readiness {
  display: flex;
  gap: 10px;
  align-items: center;
  border-radius: 18px;
  padding: 12px 14px;
  font-weight: 900;
}

.assignment-readiness.is-ready {
  border: 1px solid rgba(22, 163, 74, 0.18);
  background: rgba(220, 252, 231, 0.72);
  color: #166534;
}

.assignment-readiness.is-warning {
  border: 1px solid rgba(245, 158, 11, 0.26);
  background: rgba(255, 247, 214, 0.86);
  color: #7c4a03;
}

.assignment-form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.assignment-status {
  min-height: 24px;
  margin: 0;
}

.assignment-inline-status {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  min-height: 34px;
  border-radius: 999px;
  padding: 0 12px;
  background: rgba(255, 255, 255, 0.82);
  color: var(--muted);
  font-weight: 950;
}

.assignment-inline-status a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.assignment-inline-status.is-success {
  background: rgba(220, 252, 231, 0.9);
  color: #166534;
}

.assignment-inline-status.is-error {
  background: rgba(255, 228, 230, 0.95);
  color: #9f1239;
}

.assignment-history {
  display: grid;
  gap: 10px;
  margin-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.18);
  padding-top: 14px;
}

.assignment-history h3,
.assignment-history-empty {
  margin: 0;
}

.assignment-history h3 {
  font-size: 1rem;
  color: #fff;
}

.assignment-history-empty {
  color: rgba(255, 255, 255, 0.78);
  font-weight: 850;
}

.assignment-history-list {
  display: grid;
  gap: 8px;
}

.assignment-history-item {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 11px 12px;
  background: rgba(255, 255, 255, 0.78);
}

.assignment-history-item div {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.assignment-history-item span {
  color: var(--muted);
  font-weight: 800;
}

.assignment-history-status {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  white-space: nowrap;
  border-radius: 999px;
  padding: 0 10px;
  background: rgba(255, 244, 188, 0.95);
  color: #6f5500;
  font-size: 0.78rem;
  font-weight: 1000;
}

.assignment-history-status.status-in_progress {
  background: rgba(224, 242, 254, 0.95);
  color: #075985;
}

.assignment-history-status.status-completed {
  background: rgba(220, 252, 231, 0.95);
  color: #166534;
}

.assignment-history-status.status-canceled {
  background: rgba(241, 245, 249, 0.95);
  color: #64748b;
}

.module-panel-body.teaching-workspace {
  grid-template-columns: minmax(0, 1.7fr) minmax(330px, 0.95fr);
  gap: 14px;
}

.module-workspace-layout {
  min-height: clamp(620px, calc(100vh - 230px), 980px);
  overflow: visible;
  padding: 0;
}

.module-workspace-page.is-focus-mode .module-workspace-layout {
  min-height: calc(100vh - 128px);
}

.workspace-panel {
  min-height: 0;
  overflow: hidden;
}

.workspace-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--line);
  padding: 13px 14px;
}

.module-workspace-page.is-focus-mode .workspace-panel-header {
  padding: 9px 12px;
}

.module-workspace-page.is-focus-mode .workspace-panel-header .eyebrow {
  display: none;
}

.workspace-panel-header h3 {
  margin-bottom: 0;
}

.shared-teaching-header {
  justify-content: center;
}

.shared-teaching-header .teaching-mode-tabs {
  width: min(100%, 430px);
}

.material-workspace-panel {
  display: grid;
  grid-template-rows: auto auto auto minmax(420px, 1fr);
  border: 1px solid var(--panel-line);
  border-radius: 22px;
  background: #fff;
  box-shadow: var(--shadow-card);
}

.module-workspace-page .material-workspace-panel {
  grid-template-rows: auto auto minmax(0, 1fr);
}

.media-controls {
  display: grid;
  gap: 10px;
  border-bottom: 1px solid var(--line);
  padding: 12px 14px;
  background: #f8fbff;
}

.module-workspace-page.is-focus-mode .media-controls,
.module-workspace-page.is-focus-mode .whiteboard-toolbar,
.module-workspace-page.is-focus-mode .text-display-toolbar {
  padding: 8px 10px;
}

.media-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.media-tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 13px;
  color: var(--text);
  background: #fff;
  font: inherit;
  font-size: 0.84rem;
  font-weight: 1000;
  cursor: pointer;
  transition:
    border-color 160ms ease,
    background 160ms ease,
    box-shadow 160ms ease,
    transform 160ms ease;
}

.media-tab:hover,
.media-tab.is-active {
  border-color: rgba(24, 184, 216, 0.4);
  background: var(--brand-cyan-soft);
  color: #0b6678;
  transform: translateY(-1px);
}

.media-tab:disabled,
.media-tab.is-unavailable {
  cursor: not-allowed;
  border-style: dashed;
  color: #8a96a6;
  background: #f6f8fb;
  box-shadow: none;
  transform: none;
}

.media-tab:disabled:hover,
.media-tab.is-unavailable:hover {
  border-color: var(--line);
  color: #8a96a6;
  background: #f6f8fb;
  transform: none;
}

.media-tab.is-active {
  box-shadow: 0 10px 22px rgba(24, 184, 216, 0.16);
}

.media-tab:focus-visible {
  outline: 3px solid rgba(24, 184, 216, 0.28);
  outline-offset: 2px;
}

.media-tab .ui-icon {
  width: 17px;
  height: 17px;
}

.custom-video-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: end;
}

.custom-video-form[hidden] {
  display: none !important;
}

.custom-video-form label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 1000;
}

.custom-video-form input {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 0 13px;
  color: var(--text);
  background: #fff;
  font: inherit;
  font-weight: 850;
}

.custom-video-form input:focus-visible {
  outline: 3px solid rgba(24, 184, 216, 0.22);
  outline-offset: 2px;
}

.ecrif-media-tab {
  min-width: 46px;
  padding-inline: 15px;
}

.media-image-viewer-toolbar {
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 7px;
  max-width: 100%;
}

.media-image-viewer-toolbar[hidden] {
  display: none !important;
}

.media-annotation-toolbar {
  z-index: 2;
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
}

.media-annotation-toolbar[hidden] {
  display: none !important;
}

.media-annotation-tool-group {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.media-annotation-tool {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  min-height: 34px;
  border: 1px solid rgba(74, 47, 186, 0.14);
  border-radius: 12px;
  color: var(--brand-navy);
  background: #fff;
  font: inherit;
  font-size: 0.74rem;
  font-weight: 1000;
  cursor: pointer;
  transition:
    background 160ms ease,
    border-color 160ms ease,
    box-shadow 160ms ease,
    transform 160ms ease;
}

.media-annotation-tool:hover {
  border-color: rgba(24, 184, 216, 0.4);
  transform: translateY(-1px);
}

.media-annotation-tool.is-active {
  border-color: rgba(24, 184, 216, 0.5);
  color: #0b6678;
  background: var(--brand-cyan-soft);
  box-shadow: 0 8px 18px rgba(24, 184, 216, 0.14);
}

.media-annotation-tool:disabled {
  opacity: 0.42;
  cursor: not-allowed;
  transform: none;
}

.media-annotation-tool .ui-icon {
  width: 16px;
  height: 16px;
}

.media-annotation-tool span {
  display: none;
}

.media-annotation-color {
  width: 34px;
  height: 34px;
  border: 1px solid rgba(74, 47, 186, 0.14);
  border-radius: 10px;
  padding: 2px;
  background: #fff;
  cursor: pointer;
}

.media-annotation-size {
  width: 86px;
  accent-color: var(--accent-purple);
}

.media-annotation-text {
  width: 72px;
  min-height: 34px;
  border: 1px solid rgba(74, 47, 186, 0.14);
  border-radius: 10px;
  padding: 0 4px;
  color: var(--brand-navy);
  background: #fff;
  font: inherit;
  font-size: 0.72rem;
  font-weight: 900;
}

.media-image-expand-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  width: 38px;
  min-height: 38px;
  border: 1px solid rgba(74, 47, 186, 0.18);
  border-radius: 12px;
  padding: 0;
  color: var(--brand-navy);
  background: rgba(255, 255, 255, 0.94);
  font: inherit;
  font-size: 0.82rem;
  font-weight: 1000;
  cursor: pointer;
  box-shadow: 0 10px 24px rgba(41, 69, 112, 0.14);
  backdrop-filter: blur(10px);
  transition:
    border-color 160ms ease,
    background 160ms ease,
    box-shadow 160ms ease,
    transform 160ms ease;
}

.media-image-expand-button:hover {
  border-color: rgba(24, 184, 216, 0.42);
  background: #fff;
  transform: translateY(-1px);
}

.media-image-expand-button:focus-visible {
  outline: 3px solid rgba(24, 184, 216, 0.28);
  outline-offset: 2px;
}

.media-image-expand-button[hidden] {
  display: none !important;
}

.media-image-expand-button .ui-icon {
  width: 16px;
  height: 16px;
}

.media-image-expand-button span {
  display: none;
}

.media-image-modal {
  position: fixed;
  inset: 18px;
  z-index: 200;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
  border: 1px solid rgba(74, 47, 186, 0.18);
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 30px 90px rgba(16, 24, 40, 0.34);
}

.media-image-modal[hidden] {
  display: none !important;
}

.media-image-modal::before {
  content: "";
  position: fixed;
  inset: -18px;
  z-index: -1;
  background: rgba(20, 18, 42, 0.44);
  backdrop-filter: blur(8px);
}

.media-image-modal-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--line);
  padding: 12px 14px;
  background: #fff;
}

.media-image-modal-toolbar strong {
  min-width: 0;
  overflow: hidden;
  color: var(--brand-navy);
  font-size: 0.94rem;
  font-weight: 1000;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.media-image-modal-toolbar > div {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.media-image-zoom-controls {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  border: 1px solid rgba(74, 47, 186, 0.14);
  border-radius: 999px;
  padding: 3px;
  background: #f8fafc;
}

.media-image-zoom-controls .button {
  min-height: 34px;
  border-radius: 999px;
  padding: 0 10px;
}

.media-image-zoom-button {
  width: 34px;
  flex: 0 0 auto;
}

.media-image-zoom-button .ui-icon {
  width: 16px;
  height: 16px;
}

.media-image-zoom-reset {
  min-width: 64px;
  font-size: 0.78rem;
  font-weight: 1000;
  flex: 0 0 auto;
}

.media-image-zoom-controls .button:disabled {
  opacity: 0.42;
  cursor: not-allowed;
  transform: none;
}

.media-image-modal-stage {
  display: grid;
  place-items: center;
  min-height: 0;
  overflow: auto;
  padding: 16px;
  background: #f8fafc;
  scrollbar-gutter: stable;
}

.media-image-modal-stage.is-zoomed {
  place-items: start;
}

.media-image-modal-stage img {
  width: calc(100% * var(--media-image-zoom, 1));
  height: calc(100% * var(--media-image-zoom, 1));
  min-height: 0;
  max-width: none;
  max-height: none;
  object-fit: contain;
  border-radius: 18px;
  background: #fff;
}

body.has-media-image-modal {
  overflow: hidden;
}

.shared-teaching-workspace {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  border: 1px solid var(--panel-line);
  border-radius: 22px;
  background: #fff;
  box-shadow: var(--shadow-card);
}

.shared-teaching-header {
  align-items: center;
  gap: 12px;
  justify-content: space-between;
}

.teaching-mode-tabs {
  display: inline-grid;
  grid-template-columns: repeat(2, minmax(92px, 1fr));
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px;
  background: #f6f9fd;
}

.teaching-mode-tab {
  min-height: 38px;
  border: 0;
  border-radius: 999px;
  padding: 0 16px;
  color: var(--muted);
  background: transparent;
  font: inherit;
  font-weight: 1000;
  cursor: pointer;
  transition:
    background 160ms ease,
    color 160ms ease,
    box-shadow 160ms ease;
}

.teaching-mode-tab.is-active {
  color: #fff;
  background: linear-gradient(135deg, var(--brand-cyan), var(--accent-blue));
  box-shadow: 0 10px 22px rgba(24, 184, 216, 0.18);
}

.teaching-mode-tab:focus-visible {
  outline: 3px solid rgba(24, 184, 216, 0.28);
  outline-offset: 2px;
}

.teaching-present-button {
  flex: 0 0 auto;
}

.teaching-mode-content {
  display: grid;
  min-height: 0;
}

.teaching-mode-pane {
  grid-area: 1 / 1;
  min-height: 0;
}

.teaching-mode-pane:not(.is-active) {
  display: none;
}

.module-objective-strip {
  display: grid;
  gap: 4px;
  margin: 12px 14px 0;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 10px 12px;
  background: #f8fbff;
  color: var(--muted);
  font-weight: 800;
}

.module-objective-strip strong {
  color: var(--text);
  font-size: 0.86rem;
}

.material-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 12px 14px;
}

.material-tab {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 13px;
  color: var(--text);
  background: #fff;
  font: inherit;
  font-size: 0.86rem;
  font-weight: 1000;
  cursor: pointer;
  transition:
    border-color 160ms ease,
    background 160ms ease,
    box-shadow 160ms ease,
    transform 160ms ease;
}

.material-tab:hover:not(:disabled),
.material-tab.is-active {
  border-color: rgba(24, 184, 216, 0.4);
  background: var(--brand-cyan-soft);
  color: #0b6678;
  transform: translateY(-1px);
}

.material-tab.is-active {
  box-shadow: 0 10px 22px rgba(24, 184, 216, 0.16);
}

.material-tab:disabled {
  cursor: not-allowed;
  color: #97a2b1;
  background: #f8fafc;
}

.material-tab .ui-icon {
  width: 17px;
  height: 17px;
}

.material-viewer {
  display: grid;
  min-height: 0;
  padding: 0 14px 14px;
}

.module-workspace-page .material-viewer {
  padding: 14px;
}

.material-viewer iframe,
.media-image-layout,
.media-image-stage,
.material-placeholder,
.material-reference,
.media-loading-state,
.media-fallback-state {
  grid-area: 1 / 1;
  width: 100%;
  height: 100%;
  min-height: 420px;
  border: 1px solid rgba(88, 122, 171, 0.28);
  border-radius: 20px;
  background: #fff;
  box-shadow: 0 18px 42px rgba(41, 69, 112, 0.12);
}

.material-viewer iframe[hidden],
.media-image-layout[hidden],
.media-image-stage[hidden],
.material-placeholder[hidden],
.material-reference[hidden],
.media-loading-state[hidden],
.media-fallback-state[hidden] {
  display: none !important;
}

.material-viewer iframe {
  display: block;
}

.media-image-layout {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: stretch;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.media-image-layout.is-expanded {
  position: fixed;
  inset: 12px;
  z-index: 220;
  grid-template-rows: minmax(0, 1fr) auto;
  gap: 10px;
  width: auto;
  height: auto;
  min-height: 0;
  border: 1px solid rgba(74, 47, 186, 0.2);
  border-radius: 24px;
  padding: 10px;
  background: rgba(248, 250, 252, 0.99);
  box-shadow: 0 30px 90px rgba(16, 24, 40, 0.38);
}

.media-image-layout.is-expanded::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background: rgba(20, 18, 42, 0.48);
  backdrop-filter: blur(8px);
}

.media-image-layout.is-expanded .media-image-toolrail {
  flex-wrap: nowrap;
  justify-content: flex-start;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  scrollbar-width: thin;
}

.media-image-layout.is-expanded .media-image-content {
  min-height: 0;
}

.media-image-layout.is-expanded .media-image-stage {
  align-self: stretch;
  aspect-ratio: auto;
  height: 100%;
  max-height: none;
}

.media-image-layout.is-expanded .media-annotation-tool {
  flex: 0 0 auto;
  gap: 6px;
  padding-inline: 10px;
}

.media-image-layout.is-expanded .media-annotation-tool span,
.media-image-layout.is-expanded .media-image-expand-button span {
  display: inline;
}

.media-image-layout.is-expanded .media-image-expand-button {
  width: auto;
  padding-inline: 11px;
}

.media-image-toolrail {
  grid-row: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
  width: 100%;
  border: 1px solid rgba(74, 47, 186, 0.16);
  border-radius: 18px;
  padding: 7px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 14px 32px rgba(41, 69, 112, 0.14);
  backdrop-filter: blur(10px);
}

.media-image-content {
  grid-row: 1;
  display: grid;
  min-width: 0;
}

.media-image-stage {
  grid-area: auto;
  display: grid;
  place-items: center;
  align-self: start;
  aspect-ratio: 16 / 9;
  height: auto;
  max-height: 72vh;
  overflow: auto;
  padding: 0;
  contain: layout paint;
  scrollbar-gutter: stable;
}

.media-image-stage.is-zoomed {
  place-items: start;
}

.media-image-zoom-surface {
  display: grid;
  place-items: center;
  position: relative;
  width: calc(100% * var(--media-image-zoom, 1));
  height: calc(100% * var(--media-image-zoom, 1));
  min-width: 100%;
  min-height: 100%;
  padding: 14px;
  box-sizing: border-box;
}

.media-image-stage img {
  grid-area: 1 / 1;
  display: block;
  width: 100%;
  height: 100%;
  min-height: 0;
  object-fit: contain;
}

.media-image-stage canvas {
  grid-area: 1 / 1;
  display: block;
  width: 100%;
  height: 100%;
  min-height: 0;
  touch-action: none;
}

.is-annotation-pan .media-image-stage canvas {
  pointer-events: none;
}

.is-annotation-draw .media-image-stage canvas {
  cursor: crosshair;
}

.is-annotation-text .media-image-stage canvas {
  cursor: text;
}

.is-annotation-eraser .media-image-stage canvas {
  cursor: cell;
}

.video-viewer iframe {
  aspect-ratio: 16 / 9;
  height: auto;
  min-height: 0;
}

.material-placeholder,
.material-reference,
.media-loading-state,
.media-fallback-state {
  display: grid;
  place-items: center;
  align-content: center;
  gap: 10px;
  padding: 24px;
  text-align: center;
}

.media-loading-state,
.media-fallback-state {
  z-index: 2;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(10px);
}

.media-fallback-state {
  align-content: end;
  justify-items: center;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.08) 0%, rgba(255, 255, 255, 0.94) 72%),
    transparent;
  pointer-events: none;
}

.media-fallback-state > * {
  pointer-events: auto;
}

.media-loading-state h3,
.media-fallback-state h3 {
  margin: 0;
}

.media-loading-state p,
.media-fallback-state p {
  max-width: 540px;
  margin: 0;
  color: var(--muted);
  font-weight: 800;
}

.media-spinner {
  width: 42px;
  height: 42px;
  border: 4px solid var(--brand-cyan-soft);
  border-top-color: var(--brand-cyan);
  border-radius: 999px;
  animation: mediaSpin 900ms linear infinite;
}

.video-viewer .material-placeholder {
  min-height: 420px;
}

.video-viewer .material-placeholder .button {
  margin-top: 6px;
}

.material-placeholder-icon {
  display: grid;
  width: 68px;
  height: 68px;
  place-items: center;
  border-radius: 24px;
  background: var(--brand-yellow-soft);
  color: #7a5900;
}

.material-placeholder p,
.material-reference span {
  max-width: 540px;
  margin: 0;
  color: var(--muted);
  font-weight: 800;
}

.module-whiteboard-workspace {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  min-height: 0;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(255, 246, 217, 0.5), rgba(255, 255, 255, 0.98) 34%),
    #fff;
}

.whiteboard-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: end;
  border-bottom: 1px solid var(--line);
  padding: 10px 12px;
  background: #f8fbff;
}

.whiteboard-tool-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.whiteboard-tool-group-modes {
  flex: 1 1 260px;
}

.whiteboard-tool-group-shapes,
.whiteboard-backgrounds,
.text-background-group,
.text-preset-group {
  flex: 1 1 220px;
}

.whiteboard-tool {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 12px;
  color: var(--text);
  background: #fff;
  font: inherit;
  font-size: 0.8rem;
  font-weight: 1000;
  cursor: pointer;
  transition:
    border-color 160ms ease,
    background 160ms ease,
    transform 160ms ease;
}

.whiteboard-icon-tool {
  min-width: 46px;
  padding-inline: 10px;
}

.whiteboard-tool:hover {
  border-color: rgba(24, 184, 216, 0.42);
  transform: translateY(-1px);
}

.whiteboard-tool.is-active {
  border-color: transparent;
  color: #fff;
  background: linear-gradient(135deg, var(--brand-cyan), var(--accent-blue));
}

.whiteboard-tool .ui-icon {
  width: 17px;
  height: 17px;
}

.whiteboard-field {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 1000;
}

.whiteboard-swatch-group {
  display: flex;
  flex: 0 1 auto;
  flex-wrap: wrap;
  gap: 7px;
  align-items: end;
  min-height: 48px;
}

.whiteboard-swatch {
  width: 34px;
  height: 34px;
  border: 2px solid rgba(74, 47, 186, 0.18);
  border-radius: 999px;
  background: var(--swatch-color);
  box-shadow: 0 6px 0 rgba(36, 16, 111, 0.08);
  cursor: pointer;
}

.whiteboard-swatch.is-active {
  border-color: var(--accent-green);
  box-shadow:
    0 0 0 3px rgba(149, 244, 130, 0.35),
    0 7px 0 rgba(36, 16, 111, 0.12);
}

.teaching-more-tools {
  flex: 1 1 100%;
  border: 1px solid rgba(74, 47, 186, 0.14);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.74);
}

.teaching-more-tools summary {
  min-height: 38px;
  padding: 9px 14px;
  color: var(--brand-navy);
  font-weight: 1000;
  cursor: pointer;
}

.teaching-more-tools-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: end;
  border-top: 1px solid rgba(74, 47, 186, 0.12);
  padding: 10px;
}

.whiteboard-color-field {
  min-width: 64px;
}

.whiteboard-field input {
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
}

.whiteboard-field input[type="color"] {
  width: 52px;
  padding: 4px;
}

.whiteboard-range {
  min-width: 126px;
}

.whiteboard-text-field {
  flex: 1 1 180px;
}

.whiteboard-text-field input {
  width: 100%;
  padding: 0 12px;
  color: var(--text);
}

.whiteboard-canvas-shell {
  min-height: 0;
  padding: 12px;
  background:
    radial-gradient(circle at 1px 1px, rgba(96, 112, 134, 0.18) 1px, transparent 0) 0 0 / 18px 18px,
    #eef6ff;
}

.whiteboard-canvas-shell canvas {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 220px;
  border: 1px solid rgba(88, 122, 171, 0.28);
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 18px 42px rgba(41, 69, 112, 0.14);
  cursor: crosshair;
  touch-action: none;
}

.module-whiteboard-workspace:fullscreen {
  min-height: 100vh;
  border-radius: 0;
  padding: 0;
}

.module-whiteboard-workspace:fullscreen .whiteboard-canvas-shell canvas {
  min-height: calc(100vh - 170px);
}

.module-whiteboard-workspace:fullscreen .whiteboard-toolbar {
  overflow-x: auto;
}

.module-text-workspace {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  min-height: 0;
  overflow: hidden;
}

.shared-teaching-workspace.is-presenting .whiteboard-toolbar,
.shared-teaching-workspace.is-presenting .text-display-toolbar {
  display: none;
}

.shared-teaching-workspace.is-presenting {
  grid-template-rows: minmax(0, 1fr);
}

.shared-teaching-workspace.is-presenting .student-text-display,
.shared-teaching-workspace.is-presenting .whiteboard-canvas-shell canvas {
  min-height: 560px;
}

.module-workspace-page:fullscreen {
  width: 100%;
  min-height: 100vh;
  padding: 14px;
  overflow: auto;
  background: var(--page-bg);
}

.text-display-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: end;
  border-bottom: 1px solid var(--line);
  padding: 10px 12px;
  background: #f8fbff;
}

.text-size-select select {
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 0 10px;
  color: var(--text);
  background: #fff;
  font-weight: 900;
}

.student-text-display {
  width: calc(100% - 24px);
  height: calc(100% - 24px);
  min-height: 230px;
  margin: 12px;
  resize: none;
  border: 1px solid rgba(88, 122, 171, 0.28);
  border-radius: 20px;
  padding: 22px;
  color: var(--brand-navy);
  background: #fff;
  box-shadow: 0 18px 42px rgba(41, 69, 112, 0.12);
  font-size: 40px;
  font-weight: 700;
  line-height: 1.18;
  outline: none;
}

.student-text-display.text-background-lines {
  background:
    repeating-linear-gradient(to bottom, #ffffff 0 38px, rgba(106, 54, 216, 0.14) 39px, #ffffff 40px);
}

.student-text-display.text-background-grid {
  background:
    linear-gradient(rgba(106, 54, 216, 0.12) 1px, transparent 1px),
    linear-gradient(90deg, rgba(106, 54, 216, 0.12) 1px, transparent 1px),
    #ffffff;
  background-size: 32px 32px;
}

.student-text-display.text-background-columns {
  background:
    linear-gradient(90deg, transparent calc(50% - 1px), rgba(106, 54, 216, 0.18) calc(50% - 1px), rgba(106, 54, 216, 0.18) calc(50% + 1px), transparent calc(50% + 1px)),
    #ffffff;
}

.student-text-display:focus {
  border-color: rgba(24, 184, 216, 0.48);
  box-shadow:
    0 0 0 4px rgba(24, 184, 216, 0.14),
    0 18px 42px rgba(41, 69, 112, 0.12);
}

@keyframes panelFade {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes panelRise {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes mediaSpin {
  to {
    transform: rotate(360deg);
  }
}

.empty-state {
  display: grid;
  gap: 12px;
  justify-items: center;
  padding: 42px 22px;
  text-align: center;
}

.module-grid > .empty-state {
  grid-column: 1 / -1;
}

.empty-icon {
  width: 68px;
  height: 68px;
  border-radius: 24px;
  background: linear-gradient(135deg, var(--brand-yellow), var(--brand-cyan));
  color: var(--brand-navy);
  font-size: 1rem;
}

.empty-state h2 {
  margin-bottom: 0;
}

.empty-state p {
  max-width: 560px;
  margin-bottom: 0;
  color: var(--muted);
  font-weight: 780;
}

/* Premium kids learning workspace refresh */
.module-workspace-header,
.module-info-panel,
.module-actions-panel,
.module-video-workspace,
.workspace-panel,
.assignment-panel,
.module-media-panel,
.shared-teaching-workspace {
  border-width: 2px;
  border-color: rgba(82, 122, 180, 0.18);
  border-radius: 30px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.98), rgba(247, 251, 255, 0.98)),
    #fff;
  box-shadow: var(--shadow-card);
}

.module-workspace-header {
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(222, 248, 255, 0.74), rgba(255, 244, 191, 0.48)),
    #fff;
}

.module-workspace-header::before {
  position: absolute;
  inset: 0 0 auto;
  height: 9px;
  background: linear-gradient(90deg, var(--brand-cyan), var(--brand-yellow), var(--accent-purple), var(--accent-green));
  content: "";
}

.module-workspace-title,
.module-workspace-actions {
  position: relative;
  z-index: 1;
}

.module-sibling-link,
.workspace-resource-action,
.media-tab,
.material-tab,
.whiteboard-tool,
.teaching-mode-tab {
  border-radius: 999px;
  transition:
    background 160ms ease,
    border-color 160ms ease,
    color 160ms ease,
    box-shadow 160ms ease,
    transform 160ms ease;
}

.module-sibling-link:hover,
.workspace-resource-action:hover,
.media-tab:hover,
.material-tab:hover,
.whiteboard-tool:hover,
.teaching-mode-tab:hover {
  transform: translateY(-1px);
}

.module-action-card,
.workspace-resource-card,
.workspace-action-group,
.assignment-panel,
.material-viewer,
.whiteboard-canvas-shell,
.custom-video-form {
  border-width: 2px;
  border-color: rgba(82, 122, 180, 0.16);
  border-radius: 24px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.98), rgba(226, 239, 255, 0.44)),
    #fff;
  box-shadow: 0 10px 22px rgba(55, 83, 130, 0.09);
}

.module-action-card:hover,
.workspace-resource-card:hover {
  border-color: rgba(25, 194, 230, 0.42);
  box-shadow: var(--shadow-hover);
  transform: translateY(-2px);
}

.module-action-icon,
.workspace-resource-icon,
.material-placeholder-icon {
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 20px;
  background: linear-gradient(135deg, var(--brand-cyan-soft), #fff);
  box-shadow: 0 7px 0 rgba(20, 33, 61, 0.07);
}

.module-action-video .module-action-icon,
.media-tab[data-media-tab="video"].is-active {
  background: linear-gradient(135deg, var(--accent-coral-soft), #fff);
}

.module-action-whiteboard .module-action-icon,
.teaching-mode-tab.is-active {
  background: linear-gradient(135deg, var(--brand-yellow-soft), #fff);
}

.workspace-action-group > p,
.workspace-action-details > summary,
.module-video-header,
.workspace-panel-header,
.shared-teaching-header {
  border-color: rgba(82, 122, 180, 0.14);
}

.media-tab[aria-selected="true"],
.material-tab[aria-selected="true"],
.teaching-mode-tab.is-active,
.whiteboard-tool.is-active {
  color: #fff;
  background: linear-gradient(135deg, var(--brand-cyan), var(--accent-blue));
  box-shadow: 0 7px 0 rgba(14, 99, 125, 0.16), 0 14px 24px rgba(24, 184, 216, 0.2);
}

.module-video-workspace iframe,
.material-viewer iframe,
.whiteboard-canvas-shell canvas {
  border-radius: 22px;
}

.material-placeholder,
.media-loading-state,
.media-fallback-state {
  background:
    linear-gradient(135deg, rgba(222, 248, 255, 0.62), rgba(255, 244, 191, 0.46)),
    #fff;
}

.student-text-display {
  border-width: 2px;
  border-color: rgba(82, 122, 180, 0.18);
  border-radius: 26px;
  background:
    linear-gradient(180deg, #fff, #fbfdff);
  box-shadow: var(--shadow-card);
}

.text-display-toolbar,
.whiteboard-toolbar,
.module-panel-header {
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(222, 248, 255, 0.58));
}

/* Novakid-inspired module workspace polish */
.module-workspace-header,
.workspace-panel,
.assignment-panel,
.material-workspace-panel,
.shared-teaching-workspace {
  border-color: rgba(74, 47, 186, 0.22);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.99), rgba(246, 242, 255, 0.84) 58%, rgba(255, 251, 225, 0.58)),
    #fff;
  box-shadow:
    0 14px 0 rgba(36, 16, 111, 0.055),
    var(--shadow-card);
}

.module-workspace-header {
  border-radius: var(--radius-panel);
  background:
    radial-gradient(circle at 92% 10%, rgba(149, 244, 130, 0.22), transparent 24%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.99), rgba(239, 232, 255, 0.9) 58%, rgba(255, 247, 190, 0.7)),
    #fff;
  box-shadow:
    0 18px 0 rgba(36, 16, 111, 0.055),
    var(--shadow-panel);
}

.module-workspace-header::before {
  height: 10px;
  background: linear-gradient(90deg, var(--accent-green), var(--brand-yellow), var(--accent-purple), var(--brand-navy));
}

.module-workspace-title h1 {
  color: var(--text);
  letter-spacing: 0;
}

.module-workspace-title p {
  color: var(--muted);
  font-weight: 900;
}

.module-sibling-link,
.workspace-action-details summary,
.workspace-resource-action {
  border-color: rgba(74, 47, 186, 0.18);
  background: linear-gradient(135deg, #fff, var(--kid-lilac-soft, #f1ecff));
  color: var(--brand-navy);
  box-shadow: 0 7px 0 rgba(36, 16, 111, 0.08), 0 12px 24px rgba(53, 36, 148, 0.08);
}

.module-sibling-link:hover,
.workspace-action-details summary:hover,
.workspace-resource-action:hover {
  border-color: rgba(106, 54, 216, 0.4);
  background: linear-gradient(135deg, #fff, #efe8ff);
  box-shadow: 0 9px 0 rgba(36, 16, 111, 0.1), 0 16px 30px rgba(53, 36, 148, 0.12);
}

.module-sibling-link.is-next,
.focus-mode-button,
.workspace-resource-action.is-active {
  border-color: rgba(149, 244, 130, 0.52);
  background: linear-gradient(135deg, var(--brand-yellow), var(--accent-green));
  color: var(--brand-navy);
  box-shadow: 0 8px 0 rgba(36, 16, 111, 0.14), 0 16px 28px rgba(53, 36, 148, 0.14);
}

.focus-mode-button.is-active {
  background: linear-gradient(135deg, var(--accent-green), var(--brand-yellow));
  color: var(--brand-navy);
  box-shadow: 0 9px 0 rgba(36, 16, 111, 0.16), 0 18px 32px rgba(53, 36, 148, 0.16);
}

.workspace-action-group p {
  color: var(--brand-navy);
  letter-spacing: 0.04em;
}

.workspace-action-details[open] summary {
  color: var(--brand-navy);
  background: linear-gradient(135deg, #fff, var(--brand-yellow-soft));
  box-shadow: 0 9px 0 rgba(36, 16, 111, 0.08), 0 16px 28px rgba(53, 36, 148, 0.1);
}

.workspace-panel {
  border-radius: 32px;
}

.workspace-panel-header {
  border-bottom-color: rgba(74, 47, 186, 0.14);
  padding: 15px 18px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.97), rgba(239, 232, 255, 0.7));
}

.workspace-panel-header h3 {
  color: var(--text);
  font-weight: 1000;
  letter-spacing: 0;
}

.material-workspace-panel {
  border-radius: 34px;
}

.media-controls,
.whiteboard-toolbar,
.text-display-toolbar {
  border-bottom-color: rgba(74, 47, 186, 0.14);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(246, 242, 255, 0.78));
}

.media-tabs,
.whiteboard-tool-group {
  gap: 9px;
}

.media-tab,
.material-tab,
.whiteboard-tool,
.teaching-mode-tab {
  border-color: rgba(74, 47, 186, 0.16);
  background: linear-gradient(135deg, #fff, #f8f6ff);
  color: var(--brand-navy);
  box-shadow: 0 6px 0 rgba(36, 16, 111, 0.06), 0 10px 20px rgba(53, 36, 148, 0.06);
}

.media-tab:hover,
.material-tab:hover:not(:disabled),
.whiteboard-tool:hover,
.teaching-mode-tab:hover {
  border-color: rgba(106, 54, 216, 0.38);
  background: linear-gradient(135deg, #fff, var(--brand-cyan-soft));
  color: var(--brand-navy);
  box-shadow: 0 8px 0 rgba(36, 16, 111, 0.08), 0 14px 24px rgba(53, 36, 148, 0.1);
}

.media-tab.is-active,
.media-tab[aria-selected="true"],
.material-tab.is-active,
.material-tab[aria-selected="true"],
.teaching-mode-tab.is-active,
.whiteboard-tool.is-active {
  border-color: rgba(149, 244, 130, 0.55);
  background: linear-gradient(135deg, var(--accent-green), var(--brand-yellow));
  color: var(--brand-navy);
  box-shadow: 0 8px 0 rgba(36, 16, 111, 0.14), 0 16px 28px rgba(53, 36, 148, 0.14);
}

.media-tab[data-media-tab="module"].is-active {
  background: linear-gradient(135deg, var(--accent-green), var(--brand-yellow));
}

.media-tab[data-media-tab="wordwall"].is-active {
  background: linear-gradient(135deg, var(--brand-cyan-soft), #fff, var(--brand-yellow-soft));
}

.media-tab[data-media-tab="custom"].is-active {
  background: linear-gradient(135deg, var(--brand-yellow), var(--accent-orange-soft));
}

.media-tab.ecrif-media-tab.is-active,
.media-tab.ecrif-media-tab[aria-selected="true"] {
  border-color: rgba(149, 244, 130, 0.55);
  background: linear-gradient(135deg, rgba(232, 255, 226, 0.98), rgba(255, 247, 190, 0.9));
  color: var(--brand-navy);
  box-shadow: 0 8px 0 rgba(36, 16, 111, 0.12), 0 16px 28px rgba(53, 36, 148, 0.12);
}

.media-tab:disabled,
.media-tab.is-unavailable,
.material-tab:disabled {
  border-color: rgba(74, 47, 186, 0.12);
  background: linear-gradient(135deg, #f4f2fb, #fff);
  color: #8d88a3;
  box-shadow: none;
}

.custom-video-form {
  border-color: rgba(74, 47, 186, 0.14);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(255, 247, 190, 0.48)),
    #fff;
  box-shadow: 0 10px 22px rgba(53, 36, 148, 0.08);
}

.custom-video-form input,
.whiteboard-field input,
.text-size-select select {
  border-color: rgba(74, 47, 186, 0.18);
  border-radius: 18px;
  color: var(--brand-navy);
  background: #fff;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.72), 0 8px 18px rgba(53, 36, 148, 0.06);
}

.material-viewer {
  border: 0;
  background: transparent;
  box-shadow: none;
}

.material-viewer iframe,
.media-image-stage,
.material-placeholder,
.material-reference,
.media-loading-state,
.media-fallback-state {
  border: 2px solid rgba(74, 47, 186, 0.18);
  border-radius: 28px;
  box-shadow: 0 18px 0 rgba(36, 16, 111, 0.05), 0 26px 54px rgba(53, 36, 148, 0.14);
}

.material-viewer iframe {
  background: #170b4f;
}

.media-image-stage {
  background: #fff;
}

.material-placeholder,
.material-reference,
.media-loading-state {
  background:
    radial-gradient(circle at 85% 14%, rgba(149, 244, 130, 0.18), transparent 24%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(239, 232, 255, 0.78), rgba(255, 247, 190, 0.62)),
    #fff;
}

.media-fallback-state {
  background:
    linear-gradient(180deg, rgba(36, 16, 111, 0.04) 0%, rgba(255, 255, 255, 0.94) 68%),
    linear-gradient(135deg, rgba(239, 232, 255, 0.78), rgba(255, 247, 190, 0.58));
}

.material-placeholder-icon {
  width: 76px;
  height: 76px;
  border: 2px solid rgba(36, 16, 111, 0.08);
  border-radius: 28px;
  background: linear-gradient(135deg, var(--brand-yellow), var(--accent-green));
  color: var(--brand-navy);
  box-shadow: 0 10px 0 rgba(36, 16, 111, 0.14), 0 20px 30px rgba(53, 36, 148, 0.14);
}

.media-spinner {
  border-color: var(--brand-cyan-soft);
  border-top-color: var(--accent-purple);
}

.shared-teaching-workspace {
  border-radius: 34px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.99), rgba(232, 255, 226, 0.5) 56%, rgba(239, 232, 255, 0.66)),
    #fff;
}

.teaching-mode-tabs {
  border-color: rgba(74, 47, 186, 0.14);
  background: linear-gradient(135deg, #fff, var(--kid-lilac-soft, #f1ecff));
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.72);
}

.module-objective-strip {
  border-color: rgba(74, 47, 186, 0.16);
  background: linear-gradient(135deg, #fff, var(--brand-yellow-soft));
  color: var(--muted);
  box-shadow: 0 8px 18px rgba(53, 36, 148, 0.06);
}

.module-whiteboard-workspace {
  background:
    linear-gradient(180deg, rgba(255, 247, 190, 0.48), rgba(255, 255, 255, 0.98) 36%),
    #fff;
}

.whiteboard-canvas-shell {
  padding: 14px;
  background:
    radial-gradient(circle at 1px 1px, rgba(106, 54, 216, 0.14) 1px, transparent 0) 0 0 / 20px 20px,
    linear-gradient(135deg, rgba(239, 232, 255, 0.86), rgba(232, 255, 226, 0.56));
}

.whiteboard-canvas-shell canvas {
  border: 2px solid rgba(74, 47, 186, 0.18);
  border-radius: 26px;
  box-shadow: 0 18px 0 rgba(36, 16, 111, 0.05), 0 26px 54px rgba(53, 36, 148, 0.14);
}

.whiteboard-field {
  color: var(--muted);
}

.whiteboard-field input[type="color"] {
  min-width: 56px;
  border-radius: 18px;
}

.module-text-workspace {
  background:
    linear-gradient(180deg, rgba(239, 232, 255, 0.46), rgba(255, 255, 255, 0.98) 36%),
    #fff;
}

.student-text-display {
  border-color: rgba(74, 47, 186, 0.2);
  border-radius: 30px;
  color: var(--brand-navy);
  background:
    linear-gradient(180deg, #fff, #fffdf4);
  box-shadow: 0 18px 0 rgba(36, 16, 111, 0.05), 0 26px 54px rgba(53, 36, 148, 0.14);
}

.student-text-display:focus {
  border-color: rgba(106, 54, 216, 0.46);
  box-shadow:
    0 0 0 4px rgba(106, 54, 216, 0.14),
    0 18px 0 rgba(36, 16, 111, 0.05),
    0 26px 54px rgba(53, 36, 148, 0.14);
}

.assignment-panel {
  border-color: rgba(255, 255, 255, 0.22);
  background:
    radial-gradient(circle at 92% 10%, rgba(149, 244, 130, 0.16), transparent 24%),
    linear-gradient(135deg, #321197 0%, #2b1287 48%, #24106f 100%);
}

.assignment-loading,
.assignment-notice,
.assignment-module-summary,
.assignment-picker-toolbar,
.assignment-student-option {
  border-color: rgba(74, 47, 186, 0.16);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(246, 242, 255, 0.66));
}
