.instructor-hero,
.instructor-panel,
.instructor-placeholder {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.instructor-hero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 22px;
  padding: 28px;
}

.instructor-hero h2,
.instructor-panel h3,
.instructor-placeholder h2 {
  margin: 0;
}

.instructor-status-badge {
  display: inline-flex;
  padding: 7px 12px;
  color: var(--green-dark);
  background: var(--surface-soft);
  border: 1px solid #b9d9c4;
  border-radius: 999px;
  font-weight: 800;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 800;
  color: var(--green-dark);
  background: var(--surface-soft);
  border: 1px solid #b9d9c4;
}

.status-draft {
  color: #4b5563;
  background: #f3f4f6;
  border-color: #d1d5db;
}

.status-pending_review {
  color: #8a5a00;
  background: #fff7dc;
  border-color: #f0d486;
}

.status-published {
  color: var(--green-dark);
  background: #eaf7ed;
  border-color: #b9d9c4;
}

.status-rejected {
  color: #9f1239;
  background: #fff1f2;
  border-color: #fecdd3;
}

.status-archived {
  color: #475569;
  background: #f1f5f9;
  border-color: #cbd5e1;
}

.status-lesson-draft {
  color: #4b5563;
  background: #f3f4f6;
  border-color: #d1d5db;
}

.status-lesson-preview {
  color: #365c86;
  background: #e8f1fb;
  border-color: #bfdbfe;
}

.status-lesson-published {
  color: var(--green-dark);
  background: #eaf7ed;
  border-color: #b9d9c4;
}

.instructor-stat-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.instructor-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 22px;
}

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

.instructor-panel,
.instructor-placeholder {
  display: grid;
  gap: 14px;
  padding: 22px;
}

.instructor-course-list {
  display: grid;
  gap: 12px;
}

.instructor-course-list article {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 14px;
  background: #fbfdfb;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.instructor-course-list.detailed-list article {
  align-items: stretch;
}

.course-list-main {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.course-list-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  min-width: 160px;
}

.course-list-actions form {
  margin: 0;
}

.course-list-actions .button,
.course-list-actions button {
  width: 100%;
  justify-content: center;
}

.course-meta-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 6px 0 0;
}

.course-meta-grid div {
  padding: 10px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
}

.course-meta-grid dt {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.course-meta-grid dd {
  margin: 4px 0 0;
  color: var(--text);
  font-size: 0.9rem;
}

.instructor-course-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 8px;
}

.instructor-course-stat {
  position: relative;
  display: grid;
  align-content: center;
  min-height: 76px;
  padding: 12px 14px;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  text-decoration: none;
}

.instructor-course-stat > span:first-child {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
}

.instructor-course-stat strong {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 5px;
  margin-top: 5px;
  color: var(--text);
  font-size: 1rem;
  font-weight: 600;
}

.instructor-course-stat strong small {
  color: var(--muted);
  font-size: 0.8rem;
}

.instructor-course-stat-link {
  transition: border-color 160ms ease, background-color 160ms ease, box-shadow 160ms ease;
}

.instructor-course-stat-link:hover,
.instructor-course-stat-link:focus-visible {
  background: #f4faf6;
  border-color: #a9cfb6;
  box-shadow: 0 8px 20px rgba(22, 80, 44, 0.07);
  outline: none;
}

.instructor-course-stat-messages.has-unread {
  background: #edf8f0;
  border-color: #9bc8aa;
}

.instructor-course-stat-messages.has-unread strong {
  color: var(--green-dark);
}

.instructor-course-unread-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 23px;
  height: 23px;
  padding: 0 6px;
  color: #fff !important;
  background: var(--green);
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
}

.instructor-course-list span,
.instructor-course-list p {
  color: var(--muted);
}

.instructor-course-list p {
  margin: 8px 0 0;
}

.instructor-course-list.full-list {
  margin-top: 18px;
}

.instructor-course-form {
  display: grid;
  gap: 18px;
}

.instructor-course-form label {
  display: grid;
  gap: 8px;
  color: var(--text);
  font-weight: 800;
}

.instructor-course-form input,
.instructor-course-form select,
.instructor-course-form textarea {
  width: 100%;
  padding: 12px 13px;
  color: var(--text);
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 10px;
  font: inherit;
  font-weight: 500;
}

.instructor-course-form textarea {
  resize: vertical;
}

.form-grid.two {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.form-section-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.form-section-heading h3 {
  margin-top: 4px;
}

.form-errors {
  padding: 16px;
  color: #9f1239;
  background: #fff1f2;
  border: 1px solid #fecdd3;
  border-radius: var(--radius);
}

.form-errors ul {
  margin: 8px 0 0;
}

.sticky-actions {
  position: sticky;
  bottom: 0;
  padding: 14px 0;
  background: linear-gradient(to top, #f7faf8 75%, rgba(247, 250, 248, 0));
}

.manage-hero {
  align-items: center;
}

.manage-hero > div {
  display: grid;
  gap: 12px;
}

.compact-actions {
  justify-content: flex-end;
  margin-bottom: 0;
}

.inline-builder-form {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(220px, 2fr) 120px auto;
  align-items: end;
  gap: 12px;
}

.inline-builder-form label {
  display: grid;
  gap: 8px;
  font-weight: 800;
}

.inline-builder-form input {
  width: 100%;
  padding: 12px 13px;
  border: 1px solid var(--line);
  border-radius: 10px;
  font: inherit;
}

.module-builder-list,
.lesson-row-list {
  display: grid;
  gap: 14px;
}

.module-builder-card {
  display: grid;
  gap: 16px;
  padding: 20px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.module-builder-card header,
.lesson-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.module-builder-card h3 {
  margin: 4px 0;
}

.module-builder-card p {
  margin: 0;
  color: var(--muted);
}

.horizontal-actions {
  flex-direction: row;
  min-width: auto;
}

.lesson-row {
  align-items: center;
  padding: 12px;
  background: #fbfdfb;
  border: 1px solid var(--line);
  border-radius: 10px;
}

.lesson-row span {
  color: var(--muted);
}

.lesson-row-actions {
  display: flex;
  gap: 8px;
}

.lesson-row-actions form {
  margin: 0;
}

.rich-editor-panel {
  gap: 12px;
}

.editor-help {
  margin: 0;
  color: var(--muted);
}

.ql-toolbar.ql-snow {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 10px;
  background: #f8fcf9;
  border: 1px solid var(--line);
  border-bottom: 0;
  border-radius: var(--radius) var(--radius) 0 0;
}

.ql-toolbar.ql-snow .ql-formats {
  display: inline-flex;
  align-items: center;
  margin-right: 0;
  padding-right: 6px;
  border-right: 1px solid var(--line);
}

.ql-toolbar.ql-snow .ql-formats:last-child {
  padding-right: 0;
  border-right: 0;
}

.ql-snow .ql-stroke {
  stroke: #1e5e39;
}

.ql-snow .ql-fill,
.ql-snow .ql-picker {
  color: #1e5e39;
}

.ql-snow.ql-toolbar button:hover .ql-stroke,
.ql-snow.ql-toolbar button.ql-active .ql-stroke,
.ql-snow .ql-picker-label:hover .ql-stroke,
.ql-snow .ql-picker-label.ql-active .ql-stroke {
  stroke: var(--green);
}

.ql-snow.ql-toolbar button:hover .ql-fill,
.ql-snow.ql-toolbar button.ql-active .ql-fill,
.ql-snow .ql-picker-label:hover,
.ql-snow .ql-picker-label.ql-active {
  color: var(--green);
  fill: var(--green);
}

.ql-snow .ql-picker.ql-expanded .ql-picker-options {
  z-index: 5;
  border-color: var(--line);
  box-shadow: var(--shadow);
}

.editor-history-button {
  width: 28px;
  padding: 0;
  color: #1e5e39;
  background: transparent;
  border: 0;
  font-size: 1.25rem;
  line-height: 1;
}

.quill-editor.ql-container.ql-snow {
  min-height: 320px;
  color: var(--text);
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 0 0 var(--radius) var(--radius);
  font: inherit;
}

.quill-editor .ql-editor {
  min-height: 320px;
  padding: 20px;
  font-family: inherit;
  font-size: 1rem;
  line-height: 1.7;
}

.quill-editor .ql-editor.ql-blank::before {
  color: #8a968f;
  font-style: normal;
}

.quill-editor.ql-container.ql-snow:focus-within {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(31, 143, 95, 0.14);
}

.quill-source-input {
  display: none;
}

.quill-source-input-fallback {
  display: block;
  min-height: 180px;
}

.editor-fallback-message {
  margin: 0;
  color: #8a5a00;
  font-weight: 700;
}

.lesson-edit-lower-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(320px, .85fr);
  align-items: start;
  gap: 18px;
  margin-top: 18px;
}

.lesson-footnotes-card,
.lesson-checks-card { display: grid; gap: 16px; }

.lesson-lower-card-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.lesson-lower-card-heading h3,
.lesson-lower-card-heading p { margin: 0; }
.lesson-lower-card-heading h3 { margin-top: 3px; font-size: 1.12rem; }
.lesson-lower-card-heading > div > p:last-child { margin-top: 7px; color: var(--muted); font-size: .88rem; line-height: 1.5; }
.lesson-lower-card-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 8px; }

.new-footnote-form { position:relative; display:block; }
.new-footnote-form label { display:grid; gap:7px; font-weight:800; }
.new-footnote-form textarea,
.footnote-item-form textarea {
  width: 100%;
  min-height: 82px;
  padding: 11px 12px;
  color: var(--text);
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 9px;
  font: inherit;
  font-weight: 500;
  resize: vertical;
}

.new-footnote-form textarea:focus,
.footnote-item-form textarea:focus { border-color: var(--green); outline: 0; box-shadow: 0 0 0 3px rgba(31, 143, 95, .12); }
.new-footnote-form textarea { padding-right:52px; min-height:76px; }
.footnote-add-button { position:absolute; right:10px; bottom:10px; width:36px; height:36px; color:#fff; background:var(--green); border-color:var(--green); }
.footnote-add-button:hover { background:var(--green-dark); }
.footnote-save-button:disabled { color:#8f9892; background:#edf0ee; border-color:#dfe5e1; cursor:not-allowed; opacity:.8; }
.footnote-dirty { align-self:center; color:#8a5a00; font-weight:800; }
.footnote-inline-error { margin:6px 0 0; color:#b42318; font-size:.82rem; font-weight:700; }
.footnote-list { display: grid; gap: 10px; }
.footnote-item { display: grid; grid-template-columns: 18px 32px minmax(0, 1fr); align-items: start; gap: 9px; padding: 11px; background: #fbfdfb; border: 1px solid var(--line); border-radius: 10px; }
.footnote-handle { padding-top: 13px; color: #829088; font-size: .95rem; }
.footnote-number { display: grid; place-items: center; width: 30px; height: 30px; margin-top: 6px; color: var(--green-dark); background: #eaf7ed; border: 1px solid #cde7d5; border-radius: 50%; font-size: .8rem; font-weight: 800; }
.footnote-item-form { display: grid; gap: 8px; min-width: 0; }
.footnote-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
.footnote-actions .icon-button { width: 35px; height: 35px; }
.footnote-actions .icon-button:disabled { color: #a4aea8; background: #f4f6f4; border-color: #e2e7e3; cursor: not-allowed; }
.footnote-delete-button { color: #b42318; border-color: #f0c1bd; }
.footnote-delete-button:hover { color: #8f1d15; background: #fff4f2; }

.check-type-grid { display: grid; gap: 9px; }
.check-type-card { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; align-items: start; gap: 10px; padding: 11px; color: #58665f; background: #fbfdfb; border: 1px solid var(--line); border-radius: 10px; text-decoration: none; transition: border-color .16s ease, box-shadow .16s ease, transform .16s ease; }
.check-type-card:hover { border-color: #9dccad; box-shadow: 0 6px 16px rgba(32, 73, 49, .08); transform: translateY(-1px); }
.check-type-card > i { display: grid; place-items: center; width: 34px; height: 34px; color: var(--green-dark); background: #eaf7ed; border-radius: 8px; }
.check-type-card h4,
.check-type-card p { margin: 0; }
.check-type-card h4 { color: var(--text); font-size: .88rem; }
.check-type-card p { margin-top: 3px; font-size: .79rem; line-height: 1.35; }
.check-type-card > span { padding: 4px 7px; color: #637269; background: #f1f4f2; border-radius: 999px; font-size: .7rem; font-weight: 800; }
.created-checks-empty { padding-top: 4px; border-top: 1px solid var(--line); }
.created-checks-empty h4,
.created-checks-empty p { margin: 0; }
.created-checks-empty h4 { font-size: .92rem; }
.created-checks-empty p { margin-top: 5px; color: var(--muted); font-size: .86rem; }
.knowledge-check-list { display: grid; gap: 10px; padding-top: 4px; border-top: 1px solid var(--line); }
.knowledge-check-list > h4 { margin: 0; font-size: .92rem; }
.knowledge-check-item { display: grid; grid-template-columns: 18px 32px minmax(0, 1fr) auto; align-items: start; gap: 9px; padding: 11px; background: #fbfdfb; border: 1px solid var(--line); border-radius: 10px; }
.knowledge-check-item-content { min-width: 0; }
.knowledge-check-item-content h5,
.knowledge-check-item-content p { margin: 0; }
.knowledge-check-item-content h5 { margin-top: 4px; color: var(--text); font-size: .92rem; }
.knowledge-check-item-content p { margin-top: 4px; color: var(--muted); font-size: .8rem; line-height: 1.4; }
.knowledge-check-type { color: var(--green-dark); font-size: .74rem; font-weight: 800; }
.knowledge-check-item-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; grid-column: 3 / -1; gap: 6px; }
.knowledge-check-item-actions form { margin: 0; }
.knowledge-check-item-actions .icon-button { width: 35px; height: 35px; }
.knowledge-check-item-actions .icon-button:disabled { color: #a4aea8; background: #f4f6f4; border-color: #e2e7e3; cursor: not-allowed; }
.check-status-published { color: #176a45; background: #eaf7ed; border-color: #b9d9c4; }
.check-status-archived { color: #67746d; background: #f1f4f2; border-color: #dfe6e1; }
.check-archive-button { color: #8a5a00; border-color: #e9ce9b; }
.knowledge-check-form { max-width: 880px; }
.knowledge-check-info { max-width: 880px; }
.knowledge-builder { display: grid; gap: 16px; max-width: 980px; }
.knowledge-builder-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.knowledge-builder-bottom-add { justify-self:stretch; min-height:42px; border-style:dashed; }
.knowledge-builder-heading h3,
.knowledge-builder-heading p { margin: 0; }
.knowledge-builder-heading h3 { margin-top: 3px; font-size: 1.14rem; }
.knowledge-builder-heading > div > p:last-child { margin-top: 7px; color: var(--muted); font-size: .88rem; line-height: 1.5; }
.knowledge-builder-empty { margin: 0; padding: 18px; color: var(--muted); background: #f8fbf9; border: 1px dashed #c8dbce; border-radius: 10px; text-align: center; font-size: .9rem; }
.knowledge-builder-list { display: grid; gap: 14px; }
.knowledge-builder-item { display: grid; gap: 13px; padding: 15px; background: #fbfdfb; border: 1px solid var(--line); border-radius: 11px; }
.knowledge-builder-item { gap: 10px; padding: 12px; }
.knowledge-builder-item textarea { min-height: 68px; }
.knowledge-builder-item .form-grid { gap: 10px; }
.knowledge-builder-item label { gap: 5px; font-size: .86rem; }
.knowledge-builder-item input,.knowledge-builder-item select { min-height: 40px; }
.knowledge-builder[data-builder-type="multiple_choice"] .form-grid.two:first-of-type { grid-template-columns:repeat(2,minmax(0,1fr)); }
.knowledge-builder[data-builder-type="multiple_choice"] .form-grid.two:first-of-type label { padding:9px; background:#fff; border:1px solid #dce9e0; border-radius:8px; }
.knowledge-builder[data-builder-type="multiple_choice"] select[data-field="correct_option"] { border-color:#9dccad; background:#f1faf4; }
.knowledge-builder-item > header { display: flex; align-items: center; gap: 9px; }
.knowledge-builder-item > header > strong { color: var(--text); font-size: .95rem; }
.knowledge-builder-item-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-left: auto; }
.knowledge-builder-item-actions .icon-button { width: 34px; height: 34px; }
.knowledge-builder-item-actions .icon-button:disabled { color: #a4aea8; background: #f4f6f4; border-color: #e2e7e3; cursor: not-allowed; }
.knowledge-preview { display: grid; gap: 7px; padding: 12px 13px; background: #f2faf4; border: 1px solid #cde7d5; border-radius: 9px; }
.knowledge-preview > span { color: var(--green-dark); font-size: .72rem; font-weight: 800; text-transform: uppercase; }
.knowledge-preview p { margin: 0; color: #34423a; line-height: 1.55; white-space: pre-wrap; }
.knowledge-preview-blank { display: inline-block; min-width: 56px; margin: 0 3px; color: var(--green-dark); border-bottom: 2px solid #7fba91; text-align: center; }
.knowledge-preview p small { color: #557261; font-size: .9em; }
.knowledge-preview-options { display: grid; gap: 6px; padding: 0; margin: 0; list-style: none; }
.knowledge-preview-options li { display: grid; grid-template-columns: 22px minmax(0, 1fr) auto; gap: 6px; align-items: center; padding: 7px 9px; color: #4a5c51; background: #fff; border: 1px solid #dce9e0; border-radius: 7px; font-size: .86rem; }
.knowledge-preview-options li.is-correct { color: #176a45; background: #ebf8ef; border-color: #b9d9c4; }
.knowledge-preview-options em { padding: 3px 6px; color: #176a45; background: #dff3e5; border-radius: 999px; font-size: .68rem; font-style: normal; font-weight: 800; }
.knowledge-preview-answer { color: #176a45; font-size: .86rem; }
.knowledge-check-media-panel { display: grid; gap: 14px; max-width: 880px; }
.knowledge-check-media-toggle { display: flex; align-items: center; justify-content: space-between; width: 100%; gap: 16px; padding: 0; color: var(--text); background: transparent; border: 0; text-align: left; cursor: pointer; }
.knowledge-check-media-toggle > div { display: grid; gap: 4px; }
.knowledge-check-media-toggle h3, .knowledge-check-media-toggle p { margin: 0; }
.knowledge-check-media-toggle h3 { font-size: 1.05rem; }
.knowledge-check-media-toggle > div > p:last-child { color: var(--muted); font-size: .86rem; font-weight: 600; }
.knowledge-check-media-toggle > i { color: var(--green-dark); }
.knowledge-check-media-toggle:focus-visible { outline: 3px solid rgba(31, 143, 95, .25); outline-offset: 5px; border-radius: 8px; }
.knowledge-check-media-content { display: grid; gap: 14px; padding-top: 2px; }
.knowledge-check-media-content[hidden] { display: none; }
.knowledge-check-media-description, .knowledge-check-media-empty { margin: 0; color: var(--muted); font-size: .88rem; }
.knowledge-check-media-upload { display: grid; gap: 12px; padding: 14px; background: #f8fbf9; border: 1px solid #d9e8dd; border-radius: 10px; }
.knowledge-check-media-upload-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.knowledge-check-media-upload-actions small { color: var(--muted); }
.knowledge-check-media-list { display: grid; gap: 9px; }
.knowledge-check-media-item { display: grid; grid-template-columns: 54px minmax(0, 1fr) auto; align-items: center; gap: 11px; padding: 10px; background: #fbfdfb; border: 1px solid var(--line); border-radius: 9px; }
.knowledge-check-media-thumbnail, .knowledge-check-media-icon { display: grid; width: 54px; height: 42px; place-items: center; object-fit: cover; color: var(--green-dark); background: #eaf7ed; border-radius: 7px; }
.knowledge-check-media-copy { display: grid; gap: 3px; min-width: 0; }
.knowledge-check-media-copy span, .knowledge-check-media-copy p { margin: 0; color: var(--muted); font-size: .78rem; overflow-wrap: anywhere; }
.knowledge-check-media-actions { display: flex; align-items: center; gap: 6px; }
.mixed-add-controls { display: flex; align-items: end; gap: 8px; }
.mixed-add-controls label { min-width: 180px; color: var(--muted); font-size: .78rem; }
.mixed-add-controls select { min-height: 38px; }
.mixed-item-type { display: inline-flex; align-items: center; gap: 6px; color: var(--green-dark); font-size: .82rem; font-weight: 800; }
.mixed-builder-item.has-selected-answer .mixed-option-grid { border-color: #b9d9c4; }
.mixed-option-grid label { padding: 8px; background: #ffffff; border: 1px solid #dce9e0; border-radius: 8px; }

.dictionary-form-header,.dictionary-form-actions,.dictionary-form-actions>div,.dictionary-section-heading,.dictionary-tip{display:flex;align-items:flex-start;gap:14px}.dictionary-form-header{justify-content:space-between;margin-bottom:24px}.dictionary-form-header h2{margin:4px 0 8px;font-size:2rem}.dictionary-form-header p{margin:0;color:var(--muted)}.dictionary-back-button{color:var(--green-dark);border-color:#b9d9c4}.dictionary-form-card{padding:26px 28px}.dictionary-section-heading{margin-bottom:25px}.dictionary-section-heading>span{display:grid;place-items:center;width:42px;height:42px;color:var(--green);background:#eaf7ed;border-radius:10px}.dictionary-section-heading h3,.dictionary-section-heading p{margin:0}.dictionary-section-heading h3{font-size:1.1rem}.dictionary-section-heading p{margin-top:6px;color:var(--muted);font-size:.9rem}.dictionary-section-heading em{margin-left:auto;font-style:normal}.dictionary-word-form{gap:20px}.dictionary-word-form label{gap:6px}.dictionary-word-form label>b{color:#d92d20}.dictionary-word-form label>small{color:var(--muted);font-size:.82rem;font-weight:500}.dictionary-word-form input,.dictionary-word-form select,.dictionary-word-form textarea{min-height:44px;border-radius:10px;font-weight:500}.dictionary-word-form textarea{min-height:78px}.dictionary-word-form [aria-invalid="true"]{border-color:#d92d20;background:#fffafa}.character-count{align-self:flex-end;color:var(--muted);font-size:.78rem;font-weight:700}.field-error{color:#b42318;font-size:.82rem;font-weight:700}.dictionary-tip{padding:15px 18px;color:#176a45;background:#f0faf3;border:1px solid #cbe8d5;border-radius:10px}.dictionary-tip>i{margin-top:3px;font-size:1.05rem}.dictionary-tip strong,.dictionary-tip p{margin:0}.dictionary-tip p{margin-top:4px;font-size:.9rem}.dictionary-form-actions{align-items:center;justify-content:space-between;padding:4px 0 18px}.dictionary-form-actions>div{align-items:center}.dictionary-form-actions .button i{margin-right:6px}.dictionary-cancel-button{color:#d92d20;border:1px solid #f0a5a0;background:#fff}.dictionary-cancel-button:hover{color:#b42318;background:#fff5f4}.dictionary-word-form button:disabled{opacity:.7;cursor:wait}

.dictionary-hero {
  align-items: center;
}

.dictionary-filter-panel {
  margin-bottom: 18px;
}

.dictionary-filter-form {
  display: grid;
  grid-template-columns: minmax(200px, 2fr) repeat(3, minmax(140px, 1fr)) auto;
  align-items: end;
  gap: 12px;
}

.dictionary-filter-form label,
.dictionary-upload-form label {
  display: grid;
  gap: 8px;
  font-weight: 800;
}

.dictionary-filter-form input,
.dictionary-filter-form select,
.dictionary-upload-form input {
  width: 100%;
  padding: 12px 13px;
  color: var(--text);
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 10px;
  font: inherit;
}

.dictionary-filter-actions {
  display: flex;
  gap: 8px;
}

.dictionary-entry-list {
  display: grid;
  gap: 12px;
}

.dictionary-entry-card {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding: 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.dictionary-entry-copy {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.dictionary-entry-copy p {
  margin: 0;
  color: var(--muted);
}

.dictionary-entry-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.dictionary-entry-heading h3,
.dictionary-translation {
  margin: 0;
}

.dictionary-translation {
  color: var(--green-dark) !important;
  font-weight: 800;
}

.dictionary-entry-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.dictionary-entry-meta span {
  padding: 5px 8px;
  color: #4b5563;
  background: #f3f6f4;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 700;
}

.status-dictionary-active {
  color: var(--green-dark);
  background: #eaf7ed;
  border-color: #b9d9c4;
}

.status-dictionary-archived {
  color: #475569;
  background: #f1f5f9;
  border-color: #cbd5e1;
}

.dictionary-actions {
  min-width: 120px;
}

.dictionary-page-header,.dictionary-header-actions,.dictionary-toolbar,.dictionary-statistics,.dictionary-bulk-bar,.dictionary-pagination,.dictionary-pagination>div,.dictionary-row-actions,.modal-actions{display:flex;align-items:center;gap:12px}.dictionary-page-header{justify-content:space-between;margin-bottom:22px}.dictionary-page-header h2{margin:4px 0 8px;font-size:2rem}.dictionary-page-header p{margin:0;color:var(--muted)}.dictionary-header-actions{flex-wrap:wrap}.dictionary-header-actions i{margin-right:6px}.dictionary-statistics{margin-bottom:14px;padding:18px 22px;background:#fff;border:1px solid var(--line);border-radius:14px;box-shadow:var(--shadow)}.dictionary-statistics article{display:grid;gap:7px;flex:1;padding:0 16px;border-right:1px solid var(--line)}.dictionary-statistics article:first-child{padding-left:0}.dictionary-statistics article:last-child{border:0}.dictionary-statistics span{color:var(--muted);font-size:.78rem;font-weight:800}.dictionary-statistics strong{font-size:1.12rem}.dictionary-statistics i{color:var(--green);margin-right:5px}.dictionary-toolbar{justify-content:space-between;margin-bottom:14px;padding:14px;background:#fff;border:1px solid var(--line);border-radius:14px;box-shadow:var(--shadow)}.dictionary-toolbar form{display:flex;align-items:end;gap:10px;flex:1}.dictionary-toolbar label{display:grid;gap:5px;color:var(--muted);font-size:.75rem;font-weight:800}.dictionary-toolbar select,.dictionary-toolbar input{min-height:39px;padding:8px 10px;border:1px solid var(--line);border-radius:8px;background:#fff;font:inherit}.dictionary-search{position:relative;min-width:230px}.dictionary-search i{position:absolute;left:11px;bottom:12px;color:var(--muted)}.dictionary-search input{padding-left:32px}.dictionary-status-tabs{display:flex}.dictionary-status-tabs a{padding:10px 13px;color:var(--text);border:1px solid var(--line);font-weight:800;font-size:.84rem}.dictionary-status-tabs a:first-child{border-radius:8px 0 0 8px}.dictionary-status-tabs a:last-child{border-radius:0 8px 8px 0}.dictionary-status-tabs a.active{color:var(--green-dark);background:#edf9f0;border-color:#9bd4ad}.dictionary-bulk-bar{justify-content:space-between;margin-bottom:10px;padding:10px 14px;background:#f2fbf4;border:1px solid #cce8d4;border-radius:10px}.dictionary-bulk-bar>div{display:flex;gap:8px}.button.danger{color:#fff;background:#c62828;border-color:#c62828}.icon-button{display:inline-grid;place-items:center;width:38px;height:38px;padding:0;color:var(--text);background:#fff;border:1px solid var(--line);border-radius:8px;cursor:pointer}.icon-button.disabled{opacity:.45;pointer-events:none}.dictionary-table-card{background:#fff;border:1px solid var(--line);border-radius:14px;box-shadow:var(--shadow);overflow:hidden}.dictionary-table-wrap{overflow-x:auto}.dictionary-table{width:100%;min-width:960px;border-collapse:collapse}.dictionary-table th,.dictionary-table td{padding:12px 14px;text-align:left;vertical-align:middle;border-bottom:1px solid var(--line)}.dictionary-table th{color:var(--muted);background:#fafcfb;font-size:.76rem}.dictionary-table td{font-size:.9rem}.dictionary-example-cell{max-width:240px;color:var(--muted);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.dictionary-tag-chips{display:flex;flex-wrap:wrap;gap:5px}.dictionary-tag-chips span,.dictionary-level{display:inline-flex;padding:4px 7px;border-radius:6px;font-size:.72rem;font-weight:800}.dictionary-tag-chips span{color:var(--green-dark);background:#edf9f0;border:1px solid #cce8d4}.dictionary-level{color:var(--green-dark);background:#eff8f1}.dictionary-row-actions details{position:relative}.dictionary-row-actions summary{list-style:none}.dictionary-row-actions summary::-webkit-details-marker{display:none}.dictionary-action-menu{position:absolute;z-index:3;right:0;top:43px;display:grid;min-width:145px;padding:6px;background:#fff;border:1px solid var(--line);border-radius:8px;box-shadow:var(--shadow)}.dictionary-action-menu button{padding:8px;text-align:left;background:transparent;border:0;font:inherit;cursor:pointer}.danger-text{color:#c62828}.dictionary-pagination{justify-content:space-between;padding:12px 16px;color:var(--muted);font-size:.85rem}.page-number{display:grid;place-items:center;min-width:36px;height:36px;color:var(--text);border:1px solid var(--line);border-radius:7px}.page-number.active{color:#fff;background:var(--green);border-color:var(--green)}.dictionary-pagination select{height:36px;padding:0 8px;border:1px solid var(--line);border-radius:7px;background:#fff}.dictionary-empty>div{display:flex;justify-content:center;gap:8px}dialog{width:min(480px,calc(100vw - 32px));border:1px solid var(--line);border-radius:12px;box-shadow:0 18px 50px rgba(20,40,30,.22)}dialog::backdrop{background:rgba(20,35,28,.35)}dialog form{display:grid;gap:14px}dialog label{display:grid;gap:6px;font-weight:800}dialog input,dialog select{padding:9px;border:1px solid var(--line);border-radius:7px;font:inherit}.modal-actions{justify-content:flex-end}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}

@media(max-width:1000px){.dictionary-page-header,.dictionary-toolbar{align-items:stretch;flex-direction:column}.dictionary-statistics{display:grid;grid-template-columns:repeat(3,1fr)}.dictionary-statistics article{padding:10px;border:0}.dictionary-toolbar form{flex-wrap:wrap}.dictionary-status-tabs{align-self:flex-start}}@media(max-width:650px){.dictionary-header-actions,.dictionary-bulk-bar,.dictionary-bulk-bar>div,.dictionary-pagination,.dictionary-pagination>div{align-items:stretch;flex-direction:column}.dictionary-header-actions .button{justify-content:center}.dictionary-statistics{grid-template-columns:1fr 1fr}.dictionary-toolbar form{display:grid}.dictionary-search{min-width:0}.dictionary-empty>div{flex-direction:column}}

@media(max-width:650px){.dictionary-form-header,.dictionary-form-actions,.dictionary-form-actions>div{align-items:stretch;flex-direction:column}.dictionary-back-button,.dictionary-form-actions .button{justify-content:center}.dictionary-form-card{padding:20px}.dictionary-section-heading{gap:10px}.dictionary-section-heading p{font-size:.84rem}.dictionary-word-grid{grid-template-columns:1fr}}

.dictionary-import-panel {
  gap: 16px;
}

.dictionary-import-panel > p {
  margin: 0;
  color: var(--muted);
}

.dictionary-import-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 10px;
}

.dictionary-import-table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
  font-size: 0.88rem;
}

.dictionary-import-table th,
.dictionary-import-table td {
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}

.dictionary-import-table th {
  color: var(--green-dark);
  background: #f8fcf9;
}

.dictionary-upload-form {
  display: flex;
  align-items: end;
  gap: 12px;
}

.dictionary-upload-form label {
  flex: 1;
}

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

.import-summary-grid div {
  display: grid;
  gap: 4px;
  padding: 14px;
  background: #fbfdfb;
  border: 1px solid var(--line);
  border-radius: 10px;
}

.import-summary-grid span {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
}

.import-summary-grid strong {
  color: var(--green-dark);
  font-size: 1.35rem;
}

@media (max-width: 1100px) {
  .instructor-stat-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .instructor-hero,
  .instructor-course-list article {
    flex-direction: column;
  }

  .course-list-actions {
    align-items: stretch;
    width: 100%;
  }

  .module-builder-card header,
  .lesson-row,
  .horizontal-actions {
    flex-direction: column;
  }

  .instructor-stat-grid,
  .instructor-dashboard-grid,
  .course-meta-grid,
  .form-grid.two,
  .inline-builder-form,
  .inline-footnote-form,
  .footnote-edit-card,
  .footnote-edit-card form:first-child {
    grid-template-columns: 1fr;
  }

  .ql-toolbar.ql-snow .ql-formats {
    padding-right: 4px;
  }
}

@media (max-width: 640px) {
  .instructor-course-stats {
    grid-template-columns: 1fr;
  }
}

/* Instructor course content builder */
.course-content-page { display: grid; gap: 24px; }
.instructor-course-shell { display: grid; gap: 22px; }
.instructor-course-header { display: grid; gap: 7px; }
.instructor-course-header h2 { margin: 0; font-size: clamp(1.8rem, 3vw, 2.45rem); }
.instructor-course-header p { margin: 0; color: var(--muted); }
.instructor-course-tabs { display: flex; gap: 9px; margin: 0; padding: 2px 0 7px; overflow-x: auto; overscroll-behavior-x: contain; scrollbar-color: #bfd7c7 transparent; scrollbar-width: thin; scroll-behavior: smooth; }
.instructor-course-tabs::after { content: ""; flex: 0 0 3px; }
.instructor-course-tabs a { display: inline-flex; flex: 0 0 auto; align-items: center; gap: 8px; min-height: 42px; padding: 9px 13px; color: var(--text); background: #fff; border: 1px solid var(--line); border-radius: 9px; font-size: .88rem; font-weight: 800; white-space: nowrap; }
.instructor-course-tabs a i { width: 15px; color: var(--green-dark); text-align: center; }
.instructor-course-tabs a:hover { color: var(--green-dark); background: #f0faf3; border-color: #a9d7b8; }
.instructor-course-tabs a.active { color: #fff; background: var(--green); border-color: var(--green); box-shadow: 0 5px 12px rgba(31, 143, 95, .18); }
.instructor-course-tabs a.active i { color: #fff; }
.instructor-course-tabs a:focus-visible { outline: 3px solid rgba(31, 143, 95, .28); outline-offset: 2px; }
.course-tab-empty-state { display: grid; justify-items: center; gap: 8px; min-height: 290px; padding: 48px 24px; color: var(--muted); text-align: center; background: #fff; border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); }
.course-tab-empty-state > span { display: grid; place-items: center; width: 52px; height: 52px; color: var(--green-dark); background: #edf8f0; border-radius: 50%; font-size: 1.3rem; }
.course-tab-empty-state h3, .course-tab-empty-state p { margin: 0; }
.course-tab-empty-state h3 { color: var(--text); }
.course-content-header { display: grid; gap: 7px; }
.course-content-header h2 { margin: 0; font-size: clamp(1.8rem, 3vw, 2.45rem); }
.course-content-header p { margin: 0; color: var(--muted); }
.course-information-card { display: grid; grid-template-columns: minmax(0, 1fr) 236px; gap: 26px; padding: 24px; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow); }
.course-information-card-main { display: grid; gap: 22px; min-width: 0; }
.course-information-card .status-pill i { margin-right: 6px; font-size: .7rem; }
.course-overview-stats { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 20px 16px; }
.course-overview-stats article { display: flex; align-items: center; gap: 11px; min-width: 0; }
.course-overview-stats article > span { display: grid; flex: 0 0 46px; place-items: center; width: 46px; height: 46px; color: var(--green-dark); background: #edf8f0; border-radius: 50%; font-size: 1.1rem; }
.course-overview-stats article > div { display: grid; gap: 3px; min-width: 0; }
.course-overview-stats small { color: var(--muted); font-size: .77rem; font-weight: 700; }
.course-overview-stats strong { overflow: hidden; color: var(--text); font-size: .96rem; text-overflow: ellipsis; white-space: nowrap; }
.course-overview-stats em { color: var(--muted); font-size: .72rem; font-style: normal; }
.course-overview-actions { display: grid; align-content: center; gap: 12px; padding-left: 24px; border-left: 1px solid var(--line); }
.course-overview-actions .button { justify-content: center; }
.course-overview-actions .button i { margin-right: 7px; }
.chapter-section { display: grid; gap: 12px; }
.chapter-section-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; }
.chapter-section-header h3 { margin: 0; font-size: 1.25rem; }
.chapter-section-header p { margin: 6px 0 0; color: var(--muted); font-size: .88rem; }
.chapter-section-header p i { margin-right: 5px; color: var(--green); }
.chapter-section-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; }
.chapter-section-actions .button i { margin-right: 6px; }
.chapter-create-anchor { position: relative; }
.chapter-create-popover { position: absolute; z-index: 8; top: calc(100% + 9px); right: 0; width: min(370px, calc(100vw - 40px)); padding: 16px; background: #fff; border: 1px solid var(--line); border-radius: 11px; box-shadow: 0 16px 38px rgba(22, 45, 32, .18); }
.chapter-popover-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.chapter-popover-heading h3, .chapter-popover-heading h4 { margin: 0; font-size: 1rem; }
.chapter-create-popover form { display: grid; gap: 12px; }
.chapter-create-popover label, .lesson-chapter-dialog label { display: grid; gap: 6px; color: var(--text); font-size: .88rem; font-weight: 800; }
.chapter-create-popover label small { color: var(--muted); font-weight: 600; }
.chapter-create-popover label b { color: #c62828; }
.chapter-create-popover input, .chapter-create-popover textarea, .lesson-chapter-dialog select { width: 100%; padding: 10px; color: var(--text); background: #fff; border: 1px solid var(--line); border-radius: 8px; font: inherit; font-weight: 500; }
.chapter-create-popover textarea { resize: vertical; }
.chapter-form-errors { padding: 9px 10px; color: #9f1239; background: #fff1f2; border-radius: 8px; font-size: .84rem; }
.chapter-popover-actions { display: flex; justify-content: flex-end; gap: 8px; }
.chapter-popover-actions .button i { margin-right: 5px; }
.chapter-action-message { min-height: 1.1rem; margin: 0; color: var(--green-dark); font-size: .86rem; font-weight: 700; }
.chapter-action-message.is-error { color: #b42318; }
.chapter-list { display: grid; gap: 12px; }
.chapter-card { overflow: visible; background: var(--surface); border: 1px solid var(--line); border-radius: 13px; box-shadow: var(--shadow); transition: border-color .15s ease, opacity .15s ease, transform .15s ease; }
.chapter-card.is-dragging { opacity: .55; transform: scale(.995); }
.chapter-card.is-drop-target { border-color: var(--green); box-shadow: 0 0 0 3px rgba(31, 143, 95, .15); }
.chapter-card-header { display: flex; align-items: center; gap: 13px; padding: 18px 20px; }
.chapter-drag-handle { display: inline-grid; flex: 0 0 24px; place-items: center; width: 24px; height: 36px; padding: 0; color: #5d6b64; background: transparent; border: 0; cursor: grab; font-size: 1.12rem; }
.chapter-drag-handle:active { cursor: grabbing; }
.chapter-number { display: grid; flex: 0 0 44px; place-items: center; width: 44px; height: 33px; color: var(--green-dark); background: #edf8f0; border: 1px solid #cde7d5; border-radius: 8px; font-size: .84rem; font-weight: 800; }
.chapter-card-copy { display: grid; flex: 1; gap: 5px; min-width: 0; }
.chapter-card-copy h4 { margin: 0; font-size: 1.05rem; }
.chapter-card-copy p { margin: 0; color: var(--muted); font-size: .88rem; }
.chapter-card-copy > span { display: flex; flex-wrap: wrap; gap: 7px; color: #50605a; font-size: .81rem; }
.chapter-card-copy > span i:not(:first-child) { margin-left: 7px; }
.chapter-card-actions { display: flex; align-items: center; gap: 8px; }
.compact-button { min-height: 36px; padding: 8px 11px; font-size: .84rem; }
.compact-button i { margin-right: 5px; }
.chapter-menu { position: relative; }
.chapter-menu summary { list-style: none; }
.chapter-menu summary::-webkit-details-marker { display: none; }
.chapter-menu > div { position: absolute; z-index: 5; top: 44px; right: 0; display: grid; min-width: 185px; padding: 6px; background: #fff; border: 1px solid var(--line); border-radius: 9px; box-shadow: var(--shadow); }
.chapter-menu a, .chapter-menu button { display: block; width: 100%; padding: 9px; color: var(--text); background: transparent; border: 0; border-radius: 6px; font: inherit; font-size: .85rem; text-align: left; cursor: pointer; }
.chapter-menu a:hover, .chapter-menu button:not(:disabled):hover { background: #f3faf5; }
.chapter-menu button:disabled { opacity: .45; cursor: not-allowed; }
.chapter-menu i { width: 18px; color: var(--green-dark); }
.chapter-menu .danger-text, .chapter-menu .danger-text i { color: #b42318; }
.chapter-menu form { margin: 0; }
.chapter-lessons { padding: 0 20px 18px; }
.lesson-list-table { overflow: hidden; border: 1px solid var(--line); border-radius: 9px; }
.lesson-list-heading, .lesson-list-row { display: grid; grid-template-columns: 48px minmax(180px, 1fr) 125px 105px 100px; align-items: center; gap: 12px; padding: 11px 14px; }
.lesson-list-heading { color: var(--muted); background: #fbfdfb; border-bottom: 1px solid var(--line); font-size: .74rem; font-weight: 800; text-transform: uppercase; }
.lesson-list-row { border-bottom: 1px solid var(--line); font-size: .9rem; }
.lesson-list-row:last-child { border-bottom: 0; }
.lesson-number { display: grid; place-items: center; width: 28px; height: 28px; color: var(--green-dark); background: #edf8f0; border-radius: 50%; font-size: .8rem; font-weight: 800; }
.lesson-duration { color: var(--muted); font-size: .82rem; }
.lesson-duration i { margin-right: 5px; }
.lesson-compact-actions { display: flex; justify-content: flex-end; gap: 6px; }
.lesson-compact-actions form { margin: 0; }
.danger-icon { color: #c62828; }
.chapter-empty-lessons { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 18px; background: #fbfdfb; border: 1px dashed #c9d7ce; border-radius: 9px; }
.chapter-empty-lessons strong, .chapter-empty-lessons p { margin: 0; }
.chapter-empty-lessons p { margin-top: 4px; color: var(--muted); font-size: .88rem; }
.course-content-empty { display: grid; justify-items: center; gap: 8px; padding: 48px 24px; color: var(--muted); text-align: center; background: #fff; border: 1px dashed #b9d9c4; border-radius: 14px; }
.course-content-empty > i { display: grid; place-items: center; width: 48px; height: 48px; color: var(--green-dark); background: #edf8f0; border-radius: 50%; font-size: 1.25rem; }
.course-content-empty h4, .course-content-empty p { margin: 0; }
.course-content-empty h4 { color: var(--text); }
.lesson-chapter-dialog { width: min(420px, calc(100vw - 30px)); padding: 18px; border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 18px 50px rgba(20, 40, 30, .25); }
.lesson-chapter-dialog form { display: grid; gap: 14px; }
.lesson-chapter-dialog::backdrop { background: rgba(20, 35, 28, .35); }

@media (max-width: 1120px) {
  .course-information-card { grid-template-columns: 1fr; }
  .course-overview-stats { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .course-overview-actions { grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 18px 0 0; border-top: 1px solid var(--line); border-left: 0; }
}

@media (max-width: 760px) {
  .instructor-course-tabs { margin-right: -4px; padding-right: 18px; }
  .instructor-course-tabs a { min-height: 44px; }
  .course-information-card { padding: 18px; }
  .course-overview-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 10px; }
  .course-overview-stats article > span { flex-basis: 39px; width: 39px; height: 39px; font-size: .95rem; }
  .course-overview-stats strong { white-space: normal; }
  .course-overview-actions { grid-template-columns: 1fr; }
  .chapter-section-header, .chapter-card-header, .chapter-empty-lessons { align-items: stretch; flex-direction: column; }
  .chapter-section-actions, .chapter-card-actions { justify-content: stretch; }
  .chapter-section-actions .button { flex: 1; justify-content: center; }
  .chapter-card-header { position: relative; padding: 16px; }
  .chapter-drag-handle { position: absolute; top: 12px; right: 12px; }
  .chapter-drag-handle + .chapter-number { margin-right: 32px; }
  .chapter-card-actions { flex-wrap: wrap; }
  .compact-button { flex: 1; justify-content: center; }
  .chapter-lessons { padding: 0 16px 16px; }
  .lesson-list-heading { display: none; }
  .lesson-list-row { grid-template-columns: 32px 1fr auto; gap: 8px; }
  .lesson-list-row .status-pill { grid-column: 2; justify-self: start; }
  .lesson-duration { display: none; }
  .lesson-compact-actions { grid-column: 3; grid-row: 1 / span 2; align-self: center; }
  .chapter-create-popover { position: fixed; top: auto; right: 16px; bottom: 16px; left: 16px; width: auto; max-height: calc(100vh - 32px); overflow: auto; }
}

/* Course knowledge checks builder */
.knowledge-section-page,
.knowledge-overview-section,
.knowledge-builder-main,
.knowledge-builder-editor,
.knowledge-builder-question-workspace,
.knowledge-preview-page { display: grid; gap: 18px; }
.knowledge-section-header,
.knowledge-overview-heading,
.knowledge-builder-editor-header,
.knowledge-builder-question-workspace > header { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; }
.knowledge-section-header h2,
.knowledge-section-header p,
.knowledge-overview-heading h3,
.knowledge-overview-heading p,
.knowledge-builder-editor-header h3,
.knowledge-builder-editor-header p,
.knowledge-builder-question-workspace h3,
.knowledge-builder-question-workspace p { margin: 0; }
.knowledge-section-header h2 { margin-top: 5px; font-size: clamp(1.8rem, 3vw, 2.45rem); }
.knowledge-section-header > div > p:last-child,
.knowledge-overview-heading p,
.knowledge-builder-question-workspace p { margin-top: 6px; color: var(--muted); }
.knowledge-section-tabs { display: flex; width: fit-content; padding: 4px; background: #eef6f0; border: 1px solid #d5e5da; border-radius: 10px; }
.knowledge-section-tab { display: inline-flex; align-items: center; gap: 7px; min-height: 40px; padding: 9px 17px; color: #526159; border-radius: 7px; font-weight: 600; text-decoration: none; }
.knowledge-section-tab:hover { color: var(--green-dark); background: #f7fbf8; }
.knowledge-section-tab.active { color: #fff; background: var(--green); box-shadow: 0 4px 12px rgba(22, 122, 72, .18); }
.knowledge-builder-errors ul { margin: 8px 0 0; padding-left: 20px; }
.knowledge-folder-groups { display: grid; gap: 12px; }
.knowledge-folder-group { --folder-accent: #197d4a; --folder-soft: #edf8f0; overflow: hidden; background: #fff; border: 1px solid var(--line); border-left: 4px solid var(--folder-accent); border-radius: 10px; box-shadow: 0 8px 22px rgba(20, 42, 29, .045); }
.knowledge-folder-group.folder-color-blue,
.knowledge-folder-link.folder-color-blue { --folder-accent: #2f6fbc; --folder-soft: #edf4fc; }
.knowledge-folder-group.folder-color-purple,
.knowledge-folder-link.folder-color-purple { --folder-accent: #7454a6; --folder-soft: #f3effa; }
.knowledge-folder-group.folder-color-orange,
.knowledge-folder-link.folder-color-orange { --folder-accent: #b96516; --folder-soft: #fff3e7; }
.knowledge-folder-group.folder-color-gray,
.knowledge-folder-link.folder-color-gray { --folder-accent: #66716a; --folder-soft: #f0f3f1; }
.knowledge-folder-group-header { display: grid; width: 100%; grid-template-columns: 40px minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 14px 16px; color: var(--text); background: transparent; border: 0; font: inherit; text-align: left; cursor: pointer; }
.knowledge-folder-group-header:hover { background: #f8fbf9; }
.knowledge-folder-group-icon { display: grid; width: 40px; height: 40px; place-items: center; color: var(--folder-accent); background: var(--folder-soft); border-radius: 8px; }
.knowledge-folder-group-copy { display: grid; min-width: 0; gap: 3px; }
.knowledge-folder-group-copy strong { overflow: hidden; font-size: .96rem; text-overflow: ellipsis; white-space: nowrap; }
.knowledge-folder-group-copy small { overflow: hidden; color: var(--muted); font-size: .81rem; text-overflow: ellipsis; white-space: nowrap; }
.knowledge-folder-group-meta { display: flex; align-items: center; gap: 12px; }
.knowledge-folder-group-meta em { padding: 5px 9px; color: var(--folder-accent); background: var(--folder-soft); border-radius: 999px; font-size: .76rem; font-style: normal; white-space: nowrap; }
.knowledge-folder-group-meta > i { color: var(--muted); font-size: .8rem; transition: transform .2s ease; }
.knowledge-folder-group.is-open .knowledge-folder-group-meta > i { transform: rotate(180deg); }
.knowledge-folder-group-content { border-top: 1px solid var(--line); }
.knowledge-folder-empty { margin: 12px; padding: 16px; color: var(--muted); background: #fbfdfb; border: 1px dashed var(--line); border-radius: 8px; text-align: center; }
.knowledge-folder-table { min-width: 0; }
.knowledge-folder-table-header,
.knowledge-folder-row { display: grid; grid-template-columns: minmax(190px, 1.7fr) 76px minmax(120px, .9fr) 98px 112px minmax(230px, 1.5fr); align-items: center; gap: 12px; }
.knowledge-folder-table-header { padding: 9px 14px; color: var(--muted); background: #f7faf8; border-bottom: 1px solid var(--line); font-size: .7rem; text-transform: uppercase; }
.knowledge-folder-row { min-width: 0; padding: 12px 14px; border-bottom: 1px solid #edf1ee; font-size: .82rem; }
.knowledge-folder-row:last-child { border-bottom: 0; }
.knowledge-folder-row > * { min-width: 0; }
.knowledge-folder-row > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.knowledge-folder-row-title { display: grid; gap: 3px; }
.knowledge-folder-row-title strong,
.knowledge-folder-row-title small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.knowledge-folder-row-title small { color: var(--muted); }
.knowledge-folder-row-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.knowledge-folder-row-actions form { margin: 0; }
.knowledge-folder-row-actions .compact-button { min-height: 32px; padding: 6px 9px; font-size: .75rem; }
.knowledge-builder-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.knowledge-overview-empty,
.knowledge-builder-welcome { display: grid; justify-items: center; min-height: 330px; align-content: center; gap: 10px; padding: 38px; color: var(--muted); text-align: center; background: #fff; border: 1px dashed #b9d9c4; border-radius: 12px; }
.knowledge-overview-empty > span,
.knowledge-builder-welcome > span { display: grid; width: 54px; height: 54px; place-items: center; color: var(--green-dark); background: #eaf7ed; border-radius: 50%; font-size: 1.3rem; }
.knowledge-overview-empty h3,
.knowledge-overview-empty p,
.knowledge-builder-welcome h3,
.knowledge-builder-welcome p { margin: 0; }
.knowledge-builder-layout { display: grid; grid-template-areas: "main sidebar"; grid-template-columns: minmax(0, 1fr) 280px; align-items: start; gap: 18px; }
.knowledge-builder-main { grid-area: main; min-width: 0; }
.knowledge-builder-sidebar { position: sticky; top: 18px; grid-area: sidebar; display: grid; gap: 14px; padding: 15px; background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); }
.knowledge-builder-create { justify-content: center; }
.knowledge-builder-sidebar-heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding-top: 4px; }
.knowledge-builder-sidebar-heading h3 { margin: 0; font-size: .98rem; }
.knowledge-builder-sidebar-heading span { display: grid; width: 28px; height: 28px; place-items: center; color: var(--green-dark); background: #eaf7ed; border-radius: 50%; font-size: .8rem; font-weight: 700; }
.knowledge-builder-folders { display: grid; gap: 9px; padding-bottom: 13px; border-bottom: 1px solid var(--line); }
.knowledge-folder-add { justify-content: center; }
.knowledge-folder-list { display: grid; gap: 6px; }
.knowledge-folder-link { --folder-accent: #197d4a; --folder-soft: #edf8f0; display: grid; grid-template-columns: 30px minmax(0, 1fr) 24px; align-items: center; gap: 8px; padding: 7px; color: var(--text); border: 1px solid transparent; border-radius: 8px; text-decoration: none; }
.knowledge-folder-link:hover { background: var(--folder-soft); border-color: color-mix(in srgb, var(--folder-accent) 28%, white); }
.knowledge-folder-link > span { display: grid; width: 30px; height: 30px; place-items: center; color: var(--folder-accent); background: var(--folder-soft); border-radius: 7px; }
.knowledge-folder-link strong { overflow: hidden; font-size: .84rem; text-overflow: ellipsis; white-space: nowrap; }
.knowledge-folder-link em { color: var(--folder-accent); font-size: .76rem; font-style: normal; text-align: center; }
.knowledge-folder-form { display: grid; gap: 9px; padding: 11px; background: #f7faf8; border: 1px solid var(--line); border-radius: 9px; }
.knowledge-folder-form h4 { margin: 0; font-size: .9rem; }
.knowledge-folder-form label { display: grid; gap: 4px; font-size: .76rem; font-weight: 600; }
.knowledge-folder-form input,
.knowledge-folder-form textarea,
.knowledge-folder-form select { width: 100%; padding: 8px; background: #fff; border: 1px solid var(--line); border-radius: 7px; font: inherit; }
.knowledge-folder-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.knowledge-folder-form-actions { display: flex; justify-content: flex-end; gap: 6px; }
.knowledge-builder-draft-list { display: grid; max-height: calc(100vh - 210px); gap: 8px; overflow-y: auto; }
.knowledge-builder-draft-card { display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 9px; padding: 11px; color: var(--text); background: #fbfdfb; border: 1px solid var(--line); border-radius: 8px; text-decoration: none; }
.knowledge-builder-draft-card > span { display: grid; width: 34px; height: 34px; place-items: center; color: var(--green-dark); background: #edf8f0; border-radius: 7px; }
.knowledge-builder-draft-card div { display: grid; min-width: 0; gap: 3px; }
.knowledge-builder-draft-card strong { overflow: hidden; font-size: .87rem; text-overflow: ellipsis; white-space: nowrap; }
.knowledge-builder-draft-card small { color: var(--muted); }
.knowledge-builder-draft-card .knowledge-draft-folder { color: var(--green-dark); }
.knowledge-builder-draft-card em { grid-column: 2; color: #647068; font-size: .72rem; font-style: normal; }
.knowledge-builder-draft-card:hover,
.knowledge-builder-draft-card.active { background: #f0faf3; border-color: #9fd2ad; }
.knowledge-builder-no-drafts { margin: 0; padding: 14px 7px; color: var(--muted); font-size: .86rem; text-align: center; }
.knowledge-builder-type-selector { display: grid; gap: 20px; }
.knowledge-builder-type-selector > header h3,
.knowledge-builder-type-selector > header p { margin: 0; }
.knowledge-builder-type-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.knowledge-builder-type-card { display: grid; align-content: start; justify-items: start; min-height: 150px; gap: 9px; padding: 18px; color: #778079; background: #f8faf8; border: 1px solid #dfe6e1; border-radius: 10px; font: inherit; text-align: left; }
.knowledge-builder-type-card > i { font-size: 1.3rem; }
.knowledge-builder-type-card strong { color: #5f6862; }
.knowledge-builder-type-card > span:not(.knowledge-coming-soon) { font-size: .85rem; line-height: 1.45; }
.knowledge-builder-type-card.available { color: var(--green-dark); background: #fff; border-color: #9fd2ad; cursor: pointer; box-shadow: 0 7px 20px rgba(24, 90, 52, .06); }
.knowledge-builder-type-card.available strong { color: var(--text); }
.knowledge-builder-type-card.available:hover { transform: translateY(-1px); border-color: var(--green); }
.knowledge-coming-soon { display: inline-flex; margin-top: auto; padding: 4px 7px; color: #68736c; background: #edf0ee; border-radius: 999px; font-size: .7rem; font-weight: 700; }
.knowledge-builder-basic-form,
.knowledge-builder-settings,
.knowledge-builder-question-workspace,
.knowledge-preview-summary { padding: 20px; background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); }
.knowledge-builder-basic-form { display: grid; gap: 15px; }
.knowledge-builder-basic-form[hidden] { display: none; }
.knowledge-builder-form-heading { display: flex; align-items: flex-start; gap: 12px; }
.knowledge-builder-form-heading > span { display: grid; flex: 0 0 42px; width: 42px; height: 42px; place-items: center; color: var(--green-dark); background: #eaf7ed; border-radius: 9px; }
.knowledge-builder-form-heading h3,
.knowledge-builder-form-heading p { margin: 0; }
.knowledge-builder-form-heading p { margin-top: 5px; color: var(--muted); }
.knowledge-builder-basic-form label,
.knowledge-builder-settings label,
.knowledge-builder-question-fields label,
.knowledge-builder-pair-row label { display: grid; gap: 6px; color: var(--text); font-size: .85rem; font-weight: 600; }
.knowledge-builder-basic-form label small { color: var(--muted); font-weight: 400; }
.knowledge-builder-basic-form input,
.knowledge-builder-basic-form textarea,
.knowledge-builder-basic-form select,
.knowledge-builder-settings input,
.knowledge-builder-settings textarea,
.knowledge-builder-settings select,
.knowledge-builder-question-fields input,
.knowledge-builder-question-fields textarea,
.knowledge-builder-question-fields select { width: 100%; padding: 10px 11px; color: var(--text); background: #fff; border: 1px solid var(--line); border-radius: 8px; font: inherit; }
.knowledge-builder-form-actions { display: flex; justify-content: flex-end; }
.knowledge-builder-editor-header { padding: 2px; }
.knowledge-builder-editor-header > div:first-child { display: flex; min-width: 0; flex: 1; flex-wrap: wrap; align-items: center; gap: 9px; }
.knowledge-builder-editor-header h3 { flex: 1 0 100%; font-size: 1.55rem; }
.knowledge-builder-editor-header .knowledge-builder-actions { flex: 0 0 auto; flex-wrap: nowrap; }
.knowledge-builder-editor-header .knowledge-builder-actions .button { padding-inline: 12px; }
.knowledge-builder-settings { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.knowledge-builder-question-workspace > header { align-items: end; }
.knowledge-builder-question-toolbar.is-sticky { position: sticky; top: 12px; z-index: 4; margin: -8px -8px 0; padding: 12px; background: rgba(255, 255, 255, .97); border: 1px solid #d9e5dc; border-radius: 10px; box-shadow: 0 8px 22px rgba(20, 42, 29, .08); backdrop-filter: blur(8px); }
.knowledge-builder-add-control { display: flex; align-items: center; gap: 8px; }
.knowledge-builder-add-control select { min-height: 40px; padding: 8px 10px; background: #fff; border: 1px solid var(--line); border-radius: 8px; font: inherit; }
.knowledge-builder-add-control .button { white-space: nowrap; }
.knowledge-builder-question-list { display: grid; gap: 12px; }
.knowledge-builder-question-card { overflow: hidden; background: #fff; border: 1px solid #d9e5dc; border-radius: 10px; box-shadow: 0 5px 16px rgba(20, 42, 29, .04); }
.knowledge-builder-question-card > header { display: flex; align-items: center; gap: 9px; padding: 11px 13px; background: #f2f8f4; border-bottom: 1px solid #d9e5dc; }
.knowledge-builder-question-card.is-collapsed > header { border-bottom: 0; }
.knowledge-builder-drag-handle { width: 22px; padding: 0; color: #758078; background: transparent; border: 0; }
.knowledge-builder-question-number { display: grid; width: 28px; height: 28px; place-items: center; color: var(--green-dark); background: #fff; border: 1px solid #cde4d3; border-radius: 50%; font-size: .78rem; font-weight: 700; }
.knowledge-builder-question-summary { display: grid; min-width: 0; flex: 1; gap: 2px; }
.knowledge-builder-question-summary strong { font-size: .88rem; }
.knowledge-builder-question-summary small { overflow: hidden; color: #65736a; font-size: .76rem; text-overflow: ellipsis; white-space: nowrap; }
.knowledge-builder-question-actions { display: flex; gap: 5px; }
.knowledge-builder-question-actions .icon-button { width: 34px; height: 34px; }
.knowledge-builder-question-toggle { flex: 0 0 34px; width: 34px; height: 34px; color: var(--green-dark); }
.knowledge-builder-question-fields { display: grid; gap: 13px; padding: 14px; }
.knowledge-builder-question-fields > [data-course-question-specific] { display: grid; gap: 12px; }
.knowledge-builder-fill-preview { margin-top: 1px; }
.knowledge-builder-fill-preview p { min-height: 24px; }
.knowledge-builder-option-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
.knowledge-builder-option { grid-template-columns: 28px minmax(0, 1fr); align-items: center; }
.knowledge-builder-option > span { display: grid; width: 28px; height: 28px; place-items: center; color: var(--green-dark); background: #eaf7ed; border-radius: 50%; font-weight: 700; }
.knowledge-builder-pairs { display: grid; gap: 9px; padding: 12px; background: #fff; border: 1px solid var(--line); border-radius: 8px; }
.knowledge-builder-pairs > header { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.knowledge-builder-pairs > div { display: grid; gap: 8px; }
.knowledge-builder-pair-row { display: grid; grid-template-columns: minmax(0, 1fr) 18px minmax(0, 1fr) 36px; align-items: end; gap: 8px; }
.knowledge-builder-pair-row > i { align-self: center; color: var(--green-dark); text-align: center; }
.knowledge-builder-pair-row .icon-button { width: 36px; height: 40px; }
.knowledge-builder-bottom-add { display: grid; grid-template-columns: minmax(180px, .55fr) minmax(180px, 1fr); justify-self: stretch; padding: 12px; background: #f7fbf8; border: 1px dashed #acd0b6; border-radius: 10px; }
.knowledge-builder-bottom-add .button { justify-content: center; border-style: solid; }
.knowledge-preview-summary { display: flex; align-items: center; gap: 14px; }
.knowledge-preview-summary > span:last-child { color: var(--muted); }
.knowledge-preview-list { display: grid; gap: 14px; }
.knowledge-preview-card { display: grid; gap: 12px; padding: 20px; background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); }
.knowledge-preview-card > header { display: flex; align-items: center; gap: 9px; }
.knowledge-preview-card > header span { display: grid; width: 30px; height: 30px; place-items: center; color: var(--green-dark); background: #eaf7ed; border-radius: 50%; }
.knowledge-preview-card h3,
.knowledge-preview-card p { margin: 0; }
.knowledge-preview-answer { padding: 11px; background: #f5faf6; border-radius: 8px; }
.knowledge-preview-option-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.knowledge-preview-option-grid span { display: flex; gap: 9px; padding: 11px; border: 1px solid var(--line); border-radius: 8px; }
.knowledge-preview-option-grid span.correct { background: #eaf7ed; border-color: #9fd2ad; }
.knowledge-preview-pairs { display: grid; gap: 7px; }
.knowledge-preview-pairs span { display: grid; grid-template-columns: 1fr 24px 1fr; gap: 8px; padding: 9px; background: #f8faf8; border-radius: 7px; }
.knowledge-preview-pairs i { color: var(--green-dark); text-align: center; }
.knowledge-preview-word-chips { display: flex; flex-wrap: wrap; gap: 7px; }
.knowledge-preview-word-chips span { padding: 7px 10px; color: var(--green-dark); background: #edf8f0; border: 1px solid #cde4d3; border-radius: 7px; }
.knowledge-preview-card footer { padding-top: 10px; border-top: 1px solid var(--line); }
.knowledge-preview-card footer p { margin-top: 5px; color: var(--muted); }

@media (max-width: 1050px) {
  .knowledge-builder-layout { grid-template-areas: "main" "sidebar"; grid-template-columns: minmax(0, 1fr); }
  .knowledge-builder-sidebar { position: static; }
  .knowledge-builder-draft-list { max-height: none; }
  .knowledge-builder-settings { grid-template-columns: 1fr 1fr; }
  .knowledge-builder-settings label:nth-child(2) { grid-column: 1 / -1; grid-row: 2; }
  .knowledge-folder-table-header { display: none; }
  .knowledge-folder-row { grid-template-columns: minmax(0, 1fr) minmax(220px, auto); gap: 9px 18px; }
  .knowledge-folder-row > [data-label] { display: grid; grid-template-columns: 105px minmax(0, 1fr); align-items: center; gap: 8px; }
  .knowledge-folder-row > [data-label]::before { color: var(--muted); content: attr(data-label); font-size: .7rem; text-transform: uppercase; }
  .knowledge-folder-row-title,
  .knowledge-folder-row-actions { grid-column: 1 / -1; }
  .knowledge-folder-row-title { grid-template-columns: 105px minmax(0, 1fr); }
  .knowledge-folder-row-title::before { align-self: start; padding-top: 2px; }
  .knowledge-folder-row-title strong,
  .knowledge-folder-row-title small { grid-column: 2; }
}

@media (max-width: 760px) {
  .knowledge-section-header,
  .knowledge-overview-heading,
  .knowledge-builder-editor-header,
  .knowledge-builder-question-workspace > header { display: grid; }
  .knowledge-section-header .button,
  .knowledge-overview-heading .button { justify-content: center; }
  .knowledge-section-tabs { width: 100%; }
  .knowledge-section-tab { flex: 1; justify-content: center; }
  .knowledge-builder-layout,
  .knowledge-builder-type-grid,
  .knowledge-builder-settings { grid-template-columns: 1fr; }
  .knowledge-builder-layout { grid-template-areas: "main" "sidebar"; }
  .knowledge-builder-sidebar { position: static; }
  .knowledge-builder-draft-list { max-height: none; }
  .knowledge-builder-settings label:nth-child(2) { grid-column: auto; grid-row: auto; }
  .knowledge-builder-actions { display: grid; grid-template-columns: 1fr 1fr; }
  .knowledge-builder-actions .button { justify-content: center; }
  .knowledge-builder-actions .button:last-child { grid-column: 1 / -1; }
  .knowledge-builder-add-control { display: grid; grid-template-columns: 1fr; }
  .knowledge-builder-bottom-add { grid-template-columns: 1fr; }
  .knowledge-builder-question-toolbar.is-sticky { top: 72px; }
  .knowledge-builder-question-card > header { flex-wrap: wrap; }
  .knowledge-builder-question-summary { min-width: 150px; }
  .knowledge-builder-question-actions { order: 3; margin-left: 59px; }
  .knowledge-builder-option-grid,
  .knowledge-preview-option-grid { grid-template-columns: 1fr; }
  .knowledge-builder-pair-row { grid-template-columns: 1fr 30px; align-items: center; }
  .knowledge-builder-pair-row label { grid-column: 1; }
  .knowledge-builder-pair-row > i { display: none; }
  .knowledge-builder-pair-row .icon-button { grid-column: 2; grid-row: 1 / 3; }
  .knowledge-folder-group-header { grid-template-columns: 36px minmax(0, 1fr) auto; padding: 12px; }
  .knowledge-folder-group-icon { width: 36px; height: 36px; }
  .knowledge-folder-group-meta em { display: none; }
  .knowledge-folder-row { grid-template-columns: 1fr; padding: 12px; }
  .knowledge-folder-row > [data-label] { grid-template-columns: 1fr; gap: 3px; }
  .knowledge-folder-row-title,
  .knowledge-folder-row-actions { grid-column: auto; }
  .knowledge-folder-row-title { grid-template-columns: 1fr; }
  .knowledge-folder-row-title strong,
  .knowledge-folder-row-title small { grid-column: 1; }
  .knowledge-folder-row-actions { align-items: stretch; }
  .knowledge-folder-row-actions::before { width: 100%; }
  .knowledge-folder-row-actions .button { flex: 1 1 auto; justify-content: center; }
}

@media (max-width: 900px) {
  .dictionary-filter-form,
  .import-summary-grid {
    grid-template-columns: 1fr 1fr;
  }

  .dictionary-filter-actions,
  .dictionary-upload-form,
  .dictionary-entry-card {
    flex-direction: column;
  }

  .dictionary-actions {
    width: 100%;
  }
}

/* Course materials */
.instructor-materials-page,
.instructor-material-form-page { display: grid; gap: 22px; }
.instructor-materials-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; }
.instructor-materials-header h2 { margin: 0; font-size: clamp(1.8rem, 3vw, 2.4rem); }
.instructor-materials-header p { margin: 7px 0 0; color: var(--muted); }
.instructor-materials-header-actions,
.material-form-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 9px; }
.material-folder-editor { display: grid; gap: 16px; }
.material-folder-editor form { display: grid; gap: 14px; }
.material-folder-form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 13px; }
.material-folder-form-grid label { display: grid; gap: 6px; font-size: .8rem; font-weight: 600; }
.material-folder-form-grid input,
.material-folder-form-grid select { width: 100%; padding: 10px; background: #fff; border: 1px solid var(--line); border-radius: 8px; font: inherit; }
.material-folder-form-actions { display: flex; justify-content: flex-end; gap: 8px; }
.material-folder-groups { display: grid; gap: 12px; }
.material-folder-group { --folder-accent: #197d4a; --folder-soft: #edf8f0; overflow: hidden; background: #fff; border: 1px solid var(--line); border-left: 4px solid var(--folder-accent); border-radius: 10px; box-shadow: 0 8px 22px rgba(20, 42, 29, .045); }
.material-folder-group.folder-color-blue { --folder-accent: #2f6fbc; --folder-soft: #edf4fc; }
.material-folder-group.folder-color-purple { --folder-accent: #7454a6; --folder-soft: #f3effa; }
.material-folder-group.folder-color-orange { --folder-accent: #b96516; --folder-soft: #fff3e7; }
.material-folder-group.folder-color-gray { --folder-accent: #66716a; --folder-soft: #f0f3f1; }
.material-folder-header-shell { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; }
.material-folder-header { display: grid; width: 100%; grid-template-columns: 40px minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 14px 16px; color: var(--text); background: transparent; border: 0; font: inherit; text-align: left; cursor: pointer; }
.material-folder-header:hover { background: #f8fbf9; }
.material-folder-icon { display: grid; width: 40px; height: 40px; place-items: center; color: var(--folder-accent); background: var(--folder-soft); border-radius: 8px; }
.material-folder-copy { display: grid; min-width: 0; gap: 3px; }
.material-folder-copy strong,
.material-folder-copy small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.material-folder-copy small { color: var(--muted); font-size: .81rem; }
.material-folder-meta { display: flex; align-items: center; gap: 12px; }
.material-folder-meta em { padding: 5px 9px; color: var(--folder-accent); background: var(--folder-soft); border-radius: 999px; font-size: .76rem; font-style: normal; white-space: nowrap; }
.material-folder-meta > i { color: var(--muted); font-size: .8rem; transition: transform .2s ease; }
.material-folder-group.is-open .material-folder-meta > i { transform: rotate(180deg); }
.material-folder-edit { margin-right: 14px; }
.material-folder-content { padding: 14px; background: #fbfdfb; border-top: 1px solid var(--line); }
.material-folder-empty { margin: 0; padding: 16px; color: var(--muted); background: #fff; border: 1px dashed var(--line); border-radius: 8px; text-align: center; }
.instructor-material-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 13px; }
.instructor-material-card { display: grid; grid-template-rows: auto auto 1fr auto; min-width: 0; gap: 12px; padding: 15px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 7px 20px rgba(20, 42, 29, .05); }
.instructor-material-card > header { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.material-type-icon { display: grid; place-items: center; width: 52px; height: 52px; color: var(--green-dark); background: #eef8f1; border-radius: 12px; font-size: 1.35rem; }
.material-type-pdf { color: #b42318; background: #fff1f0; }
.material-type-document { color: #175cd3; background: #eff6ff; }
.material-type-presentation { color: #c4320a; background: #fff4ed; }
.material-type-spreadsheet { color: #067647; background: #ecfdf3; }
.instructor-material-copy { display: grid; min-width: 0; gap: 5px; }
.instructor-material-copy h3,
.instructor-material-copy p { margin: 0; }
.instructor-material-copy h3 { font-size: .98rem; overflow-wrap: anywhere; }
.instructor-material-copy small,
.instructor-material-copy p { color: var(--muted); font-size: .8rem; overflow-wrap: anywhere; }
.instructor-material-copy p { line-height: 1.45; }
.material-meta { display: flex; flex-wrap: wrap; gap: 8px 15px; margin-top: 11px; color: #52615a; font-size: .81rem; }
.material-meta i { color: var(--green-dark); }
.instructor-material-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding-top: 10px; border-top: 1px solid var(--line); }
.instructor-material-actions form { margin: 0; }
.instructor-material-actions .compact-button { min-height: 32px; padding: 6px 9px; font-size: .74rem; }
.material-form { max-width: 960px; }
.material-form-card { display: grid; gap: 18px; }
.material-current-file { margin: 0; padding: 12px; color: #4b5b53; background: #f6fbf7; border: 1px solid #d7eadc; border-radius: 9px; overflow-wrap: anywhere; }
.material-current-file i { margin-right: 6px; color: var(--green-dark); }
.instructor-materials-empty { min-height: 280px; }

@media (max-width: 760px) {
  .instructor-materials-header,
  .material-folder-form-grid { grid-template-columns: 1fr; }
  .instructor-materials-header { display: grid; }
  .instructor-materials-header-actions,
  .instructor-material-actions { justify-content: flex-start; }
  .material-type-icon { width: 46px; height: 46px; }
  .material-folder-header { grid-template-columns: 36px minmax(0, 1fr) auto; padding: 12px; }
  .material-folder-icon { width: 36px; height: 36px; }
  .material-folder-meta em { display: none; }
  .material-folder-content { padding: 10px; }
  .instructor-material-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
  .instructor-material-card { padding: 11px; }
  .instructor-material-actions { display: grid; grid-template-columns: 1fr; }
  .instructor-material-actions form,
  .instructor-material-actions .button { width: 100%; }
  .instructor-material-actions .button { justify-content: center; }

  .lesson-edit-lower-grid { grid-template-columns: 1fr; }
  .new-footnote-form { grid-template-columns: 1fr; }
  .new-footnote-form .button { justify-content: center; }
  .knowledge-check-item-actions { justify-content: flex-start; }
  .knowledge-builder-heading { display: grid; }
  .knowledge-builder-heading .button { justify-content: center; }
  .mixed-add-controls { align-items: stretch; flex-direction: column; }
  .mixed-add-controls label { min-width: 0; }
  .knowledge-check-media-upload-actions, .knowledge-check-media-item { align-items: stretch; grid-template-columns: 1fr; }
  .knowledge-check-media-upload-actions { display: grid; }
  .knowledge-check-media-actions { justify-content: flex-start; }
}

@media (max-width: 380px) {
  .instructor-material-grid { grid-template-columns: 1fr; }
}

@media (max-width: 520px) {
  .footnote-item { grid-template-columns: 18px 30px minmax(0, 1fr); padding: 9px; gap: 7px; }
  .footnote-actions { justify-content: flex-start; }
  .footnote-actions .compact-button { flex: 1; }
  .check-type-card { grid-template-columns: 34px minmax(0, 1fr); }
  .check-type-card > span { grid-column: 2; justify-self: start; }
  .lesson-lower-card-heading { display: grid; }
  .lesson-lower-card-actions { justify-content: flex-start; }
  .knowledge-check-item { grid-template-columns: 18px 30px minmax(0, 1fr); padding: 9px; gap: 7px; }
  .knowledge-check-item > .status-pill { grid-column: 3; justify-self: start; }
  .knowledge-check-item-actions { grid-column: 1 / -1; }
  .knowledge-builder-item { padding: 11px; }
  .knowledge-builder-item > header { align-items: flex-start; }
  .knowledge-builder-item-actions { justify-content: flex-start; margin-left: 0; }
  .knowledge-preview-options li { grid-template-columns: 22px minmax(0, 1fr); }
  .knowledge-preview-options em { grid-column: 2; justify-self: start; }
}

/* Course Hangman builder */
.hangman-builder-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; margin-bottom: 20px; }
.hangman-builder-header > div { max-width: 760px; }
.hangman-builder-header a { display: inline-flex; align-items: center; gap: 8px; margin-bottom: 18px; color: var(--green-dark); font-weight: 600; text-decoration: none; }
.hangman-builder-header h2, .hangman-builder-header p { margin: 0; }
.hangman-builder-header h2 { margin-bottom: 7px; font-size: 1.8rem; }
.hangman-builder-header > div > p:last-child { color: var(--muted); }
.hangman-builder-form { display: grid; gap: 18px; padding-bottom: 88px; }
.hangman-builder-card { padding: 20px; background: #fff; border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 8px 24px rgba(24, 65, 40, .05); }
.hangman-builder-card > header { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 18px; }
.hangman-builder-card > header > span { display: grid; flex: 0 0 42px; width: 42px; height: 42px; place-items: center; color: var(--green-dark); background: #eaf7ed; border-radius: 8px; }
.hangman-builder-card > header h3, .hangman-builder-card > header p { margin: 0; }
.hangman-builder-card > header p { margin-top: 4px; color: var(--muted); font-size: .87rem; }
.hangman-builder-settings-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.hangman-builder-settings-grid label, .hangman-manual-word label { display: grid; align-content: start; gap: 6px; font-size: .84rem; font-weight: 600; }
.hangman-builder-settings-grid input, .hangman-builder-settings-grid textarea, .hangman-builder-settings-grid select,
.hangman-manual-word input, .hangman-manual-word textarea { width: 100%; padding: 10px 11px; color: var(--text); background: #fff; border: 1px solid var(--line); border-radius: 7px; font: inherit; }
.hangman-builder-settings-grid small { color: var(--muted); font-weight: 400; }
.hangman-field-wide { grid-column: 1 / -1; }
.hangman-builder-word-grid { display: grid; grid-template-columns: minmax(0, .85fr) minmax(0, 1.15fr); align-items: start; gap: 18px; }
.hangman-word-search { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 9px; padding: 8px 10px; margin-bottom: 10px; border: 1px solid var(--line); border-radius: 7px; }
.hangman-word-search i { color: var(--muted); }
.hangman-word-search input { min-width: 0; border: 0; outline: 0; font: inherit; }
.hangman-word-search span { display: grid; min-width: 27px; height: 27px; padding-inline: 7px; place-items: center; color: var(--green-dark); background: #eaf7ed; border-radius: 999px; font-size: .77rem; font-weight: 700; }
.hangman-dictionary-list { display: grid; max-height: 510px; gap: 7px; overflow-y: auto; padding-right: 4px; }
.hangman-dictionary-list label { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 10px; border: 1px solid var(--line); border-radius: 7px; cursor: pointer; }
.hangman-dictionary-list label:hover { background: #f7fbf8; border-color: #b9d9c1; }
.hangman-dictionary-list label:has(input:checked) { background: #eef9f1; border-color: #70ba82; }
.hangman-dictionary-list label > span { display: grid; min-width: 0; gap: 2px; }
.hangman-dictionary-list label strong, .hangman-dictionary-list label small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hangman-dictionary-list label small { color: var(--muted); }
.hangman-dictionary-list label > i { color: var(--green); opacity: 0; }
.hangman-dictionary-list label:has(input:checked) > i { opacity: 1; }
.hangman-manual-list { display: grid; gap: 10px; }
.hangman-manual-word { padding: 12px; background: #fbfdfb; border: 1px solid var(--line); border-radius: 8px; }
.hangman-manual-word > header { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 11px; }
.hangman-manual-word > header > span { display: flex; align-items: center; gap: 9px; }
.hangman-manual-word > header i { color: var(--muted); }
.hangman-manual-word > header em { display: inline-grid; width: 25px; height: 25px; margin-left: 4px; place-items: center; color: var(--green-dark); background: #e7f5eb; border-radius: 50%; font-size: .75rem; font-style: normal; }
.hangman-manual-word > div { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.hangman-manual-word label:last-child { grid-column: 1 / -1; }
.hangman-add-word { width: 100%; justify-content: center; margin-top: 12px; border-style: dashed; }
.hangman-builder-empty { display: grid; min-height: 230px; place-items: center; align-content: center; gap: 10px; color: var(--muted); text-align: center; }
.hangman-builder-empty > i { font-size: 1.8rem; color: #8bbb98; }
.hangman-builder-actions { position: sticky; z-index: 5; bottom: 12px; display: flex; align-items: center; justify-content: flex-end; gap: 9px; padding: 12px; background: rgba(255, 255, 255, .96); border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 10px 28px rgba(20, 50, 31, .12); backdrop-filter: blur(8px); }
.knowledge-builder-type-card[href] { text-decoration: none; }

@media (max-width: 1050px) {
  .hangman-builder-word-grid { grid-template-columns: 1fr; }
  .hangman-dictionary-list { max-height: 360px; }
}

@media (max-width: 700px) {
  .hangman-builder-header { display: grid; }
  .hangman-builder-settings-grid, .hangman-manual-word > div { grid-template-columns: 1fr; }
  .hangman-manual-word label:last-child, .hangman-field-wide { grid-column: auto; }
  .hangman-builder-card { padding: 15px; }
  .hangman-builder-actions { display: grid; grid-template-columns: 1fr 1fr; bottom: 76px; }
  .hangman-builder-actions .button { justify-content: center; }
}

/* Course Crossword builder */
.crossword-builder-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 18px; }
.crossword-builder-header > div { max-width: 760px; }
.crossword-builder-header a { display: inline-flex; align-items: center; gap: 8px; margin-bottom: 16px; color: var(--green-dark); font-weight: 600; text-decoration: none; }
.crossword-builder-header h2, .crossword-builder-header p { margin: 0; }
.crossword-builder-header h2 { margin: 5px 0 7px; font-size: 1.8rem; }
.crossword-builder-header > div > p:last-child { color: var(--muted); }
.crossword-builder-header-actions { display: flex; align-items: center; gap: 10px; }
.crossword-builder-header .crossword-builder-header-actions { max-width: none; }
.crossword-builder-header .crossword-builder-header-actions a { margin-bottom: 0; }
.crossword-publish-bar { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 18px; padding: 14px 16px; background: #f2f9f4; border: 1px solid #cfe4d5; border-radius: 8px; }
.crossword-publish-bar > div { display: flex; align-items: flex-start; gap: 10px; }
.crossword-publish-bar > div > i { margin-top: 3px; color: #0b7a4d; }
.crossword-publish-bar strong { display: block; color: #185a3e; }
.crossword-publish-bar p { margin: 2px 0 0; color: var(--muted); }
.crossword-settings-card, .crossword-grid-card, .crossword-word-form-card, .crossword-word-list-card { background: #fff; border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 8px 24px rgba(24, 65, 40, .05); }
.crossword-settings-card { display: grid; gap: 17px; padding: 20px; }
.crossword-settings-card > header, .crossword-word-form-card > header { display: flex; align-items: flex-start; gap: 11px; }
.crossword-settings-card > header > span, .crossword-word-form-card > header > span { display: grid; flex: 0 0 40px; width: 40px; height: 40px; place-items: center; color: var(--green-dark); background: #eaf7ed; border-radius: 8px; }
.crossword-settings-card h3, .crossword-settings-card p, .crossword-word-form-card h3, .crossword-word-form-card p { margin: 0; }
.crossword-settings-card header p, .crossword-word-form-card header p { margin-top: 3px; color: var(--muted); font-size: .84rem; }
.crossword-settings-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 13px; }
.crossword-settings-grid label, .crossword-word-form-card label { display: grid; gap: 6px; font-size: .82rem; font-weight: 600; }
.crossword-settings-grid input, .crossword-settings-grid select, .crossword-settings-grid textarea,
.crossword-word-form-card input, .crossword-word-form-card textarea { width: 100%; padding: 10px 11px; color: var(--text); background: #fff; border: 1px solid var(--line); border-radius: 7px; font: inherit; }
.crossword-field-wide { grid-column: 1 / -1; }
.crossword-settings-card > footer { display: flex; justify-content: flex-end; gap: 9px; }
.crossword-draft-note { display: flex; align-items: center; gap: 11px; padding: 13px 15px; margin: 16px 0; color: #315940; background: #eff8f1; border: 1px solid #cfe4d4; border-radius: 8px; }
.crossword-draft-note > i { color: var(--green-dark); }
.crossword-draft-note strong, .crossword-draft-note p { margin: 0; }
.crossword-draft-note p { margin-top: 2px; font-size: .82rem; }
.crossword-builder-workspace { display: grid; grid-template-columns: minmax(540px, 1.25fr) minmax(330px, .75fr); align-items: start; gap: 16px; }
.crossword-grid-card { min-width: 0; padding: 17px; }
.crossword-grid-card > header, .crossword-word-list-card > header { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.crossword-grid-card h3, .crossword-grid-card p, .crossword-word-list-card h3, .crossword-word-list-card p { margin: 0; }
.crossword-grid-card header p, .crossword-word-list-card header p { margin-top: 3px; color: var(--muted); font-size: .82rem; }
.crossword-grid-card > header > span { padding: 6px 9px; color: var(--green-dark); background: #edf8f0; border-radius: 999px; font-size: .76rem; white-space: nowrap; }
.crossword-grid-scroll { max-width: 100%; overflow: auto; padding: 4px; border-radius: 7px; }
.crossword-grid { display: grid; width: max-content; grid-template-columns: repeat(15, 34px); grid-template-rows: repeat(15, 34px); gap: 2px; padding: 8px; background: #e3ebe5; border: 1px solid #cfdbd2; border-radius: 8px; }
.crossword-cell { position: relative; display: grid; width: 34px; height: 34px; padding: 0; place-items: center; color: #86928b; background: #f4f7f5; border: 1px solid #d6dfd8; border-radius: 3px; cursor: pointer; }
.crossword-cell:hover { background: #edf7f0; border-color: #8fc49d; }
.crossword-cell.is-used { color: var(--text); background: #fff; border-color: #a8c9b0; box-shadow: inset 0 0 0 1px rgba(31, 145, 84, .08); }
.crossword-cell.is-selected { outline: 3px solid rgba(31, 145, 84, .28); outline-offset: 1px; border-color: var(--green); }
.crossword-cell.is-highlighted { color: #073b21; background: #bce9c7; border-color: #26975a; }
.crossword-cell [data-cell-letter] { font-size: .86rem; line-height: 1; }
.crossword-cell [data-cell-number] { position: absolute; top: 1px; left: 2px; color: var(--green-dark); font-size: .49rem; line-height: 1; }
.crossword-builder-panel { display: grid; min-width: 0; gap: 14px; }
.crossword-word-form-card, .crossword-word-list-card { padding: 16px; }
.crossword-word-form-card form { display: grid; gap: 12px; margin-top: 15px; }
.crossword-position-summary { display: flex; align-items: center; gap: 7px; padding: 9px 10px; color: #476054; background: #f5faf6; border-radius: 7px; font-size: .8rem; }
.crossword-position-summary i { color: var(--green-dark); }
.crossword-position-summary strong { margin-left: auto; }
.crossword-word-form-card fieldset { min-width: 0; padding: 0; border: 0; }
.crossword-word-form-card legend { margin-bottom: 7px; font-size: .82rem; font-weight: 600; }
.crossword-direction-options { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.crossword-direction-options label { cursor: pointer; }
.crossword-direction-options input { position: absolute; opacity: 0; pointer-events: none; }
.crossword-direction-options span { display: flex; align-items: center; justify-content: center; gap: 7px; min-height: 39px; padding: 8px; border: 1px solid var(--line); border-radius: 7px; }
.crossword-direction-options input:checked + span { color: var(--green-dark); background: #eaf7ed; border-color: #72b784; }
.crossword-inline-error { padding: 9px 10px; color: #9f2f25; background: #fff2f0; border-radius: 7px; font-size: .8rem; }
.crossword-word-form-actions { display: grid; grid-template-columns: 1fr 1.25fr; gap: 8px; }
.crossword-word-form-actions .button { justify-content: center; }
.crossword-word-list-card > header > span { display: grid; min-width: 28px; height: 28px; place-items: center; color: var(--green-dark); background: #eaf7ed; border-radius: 50%; font-size: .78rem; }
.crossword-word-list { display: grid; max-height: 540px; gap: 8px; overflow-y: auto; padding-right: 3px; }
.crossword-word-item { padding: 11px; background: #fbfdfb; border: 1px solid var(--line); border-radius: 7px; }
.crossword-word-item > header { display: flex; align-items: center; gap: 9px; }
.crossword-word-item > header > span { display: grid; flex: 0 0 27px; width: 27px; height: 27px; place-items: center; color: #fff; background: var(--green); border-radius: 50%; font-size: .74rem; }
.crossword-word-item > header > div { display: grid; min-width: 0; gap: 2px; }
.crossword-word-item > header strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.crossword-word-item > header small, .crossword-word-item > small { color: var(--muted); font-size: .74rem; }
.crossword-word-item > p { margin: 9px 0 4px; font-size: .86rem; }
.crossword-word-item > footer { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; padding-top: 9px; border-top: 1px solid var(--line); }
.crossword-word-item > footer form { margin: 0; }
.crossword-empty { display: grid; min-height: 150px; place-items: center; align-content: center; gap: 9px; color: var(--muted); text-align: center; }
.crossword-empty i { color: #8bbb98; font-size: 1.6rem; }
.crossword-empty p { margin: 0; }

@media (max-width: 1120px) {
  .crossword-builder-workspace { grid-template-columns: minmax(0, 1fr); }
  .crossword-builder-panel { grid-template-columns: minmax(280px, .8fr) minmax(320px, 1.2fr); }
}

@media (max-width: 760px) {
  .crossword-builder-header, .crossword-settings-card > footer { display: grid; }
  .crossword-builder-header-actions, .crossword-publish-bar { align-items: stretch; flex-direction: column; }
  .crossword-publish-bar .button { width: 100%; }
  .crossword-settings-grid, .crossword-builder-panel { grid-template-columns: 1fr; }
  .crossword-field-wide { grid-column: auto; }
  .crossword-settings-card, .crossword-grid-card, .crossword-word-form-card, .crossword-word-list-card { padding: 13px; }
  .crossword-settings-card > footer .button { justify-content: center; }
  .crossword-grid-scroll { width: 100%; overflow-x: auto; overscroll-behavior-x: contain; }
  .crossword-word-list { max-height: none; }
}

/* Course Word Search builder */
.word-search-builder-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 18px; }
.word-search-builder-header > div { max-width: 760px; }
.word-search-builder-header a { display: inline-flex; align-items: center; gap: 8px; margin-bottom: 16px; color: var(--green-dark); font-weight: 600; text-decoration: none; }
.word-search-builder-header h2, .word-search-builder-header p { margin: 0; }
.word-search-builder-header h2 { margin: 5px 0 7px; font-size: 1.8rem; }
.word-search-builder-header > div > p:last-child { color: var(--muted); }
.word-search-builder-header-actions { display: flex; align-items: center; gap: 10px; max-width: none !important; }
.word-search-builder-header-actions .button { margin: 0; }
.word-search-settings-card, .word-search-word-form-card, .word-search-word-list-card, .word-search-grid-card { background: #fff; border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 8px 24px rgba(24, 65, 40, .05); }
.word-search-settings-card { display: grid; gap: 17px; padding: 20px; }
.word-search-settings-card > header, .word-search-word-form-card > header { display: flex; align-items: flex-start; gap: 11px; }
.word-search-settings-card > header > span, .word-search-word-form-card > header > span { display: grid; flex: 0 0 40px; width: 40px; height: 40px; place-items: center; color: var(--green-dark); background: #eaf7ed; border-radius: 8px; }
.word-search-settings-card h3, .word-search-settings-card p, .word-search-word-form-card h3, .word-search-word-form-card p { margin: 0; }
.word-search-settings-card header p, .word-search-word-form-card header p { margin-top: 3px; color: var(--muted); font-size: .84rem; }
.word-search-settings-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 13px; }
.word-search-settings-grid label, .word-search-word-form-card label { display: grid; gap: 6px; font-size: .82rem; font-weight: 600; }
.word-search-settings-grid input, .word-search-settings-grid select, .word-search-settings-grid textarea, .word-search-word-form-card input, .word-search-word-form-card textarea { width: 100%; padding: 10px 11px; color: var(--text); background: #fff; border: 1px solid var(--line); border-radius: 7px; font: inherit; }
.word-search-field-wide { grid-column: 1 / -1; }
.word-search-toggle { display: flex !important; align-items: center; gap: 11px !important; padding: 12px; background: #f7fbf8; border: 1px solid #dbe9df; border-radius: 8px; cursor: pointer; }
.word-search-toggle input { width: 18px; height: 18px; accent-color: var(--green); }
.word-search-toggle > span { display: grid; flex: 0 0 34px; width: 34px; height: 34px; place-items: center; color: var(--green-dark); background: #e6f4e9; border-radius: 7px; }
.word-search-toggle div { display: grid; gap: 2px; }
.word-search-toggle small { color: var(--muted); font-weight: 400; }
.word-search-settings-card > footer { display: flex; justify-content: flex-end; gap: 9px; }
.word-search-coming-soon, .word-search-warning { display: flex; align-items: flex-start; gap: 11px; padding: 13px 15px; margin: 16px 0; color: #315940; background: #eff8f1; border: 1px solid #cfe4d4; border-radius: 8px; }
.word-search-publish-bar { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin: 16px 0; padding: 15px 17px; background: #eff8f1; border: 1px solid #cfe4d4; border-radius: 8px; }
.word-search-publish-bar > div:first-child { display: flex; align-items: flex-start; gap: 11px; }
.word-search-publish-bar > div:first-child > i { margin-top: 3px; color: var(--green-dark); }
.word-search-publish-bar strong, .word-search-publish-bar p { margin: 0; }
.word-search-publish-bar p { margin-top: 3px; color: #52705c; font-size: .82rem; }
.word-search-publish-actions { display: flex; flex: 0 0 auto; gap: 9px; }
.word-search-publish-actions form { margin: 0; }
.word-search-warning { color: #815410; background: #fff8e9; border-color: #f0d69d; }
.word-search-coming-soon i, .word-search-warning i { margin-top: 3px; color: var(--green-dark); }
.word-search-warning i { color: #b16b09; }
.word-search-coming-soon strong, .word-search-coming-soon p, .word-search-warning p { margin: 0; }
.word-search-coming-soon p, .word-search-warning p { margin-top: 2px; font-size: .82rem; }
.word-search-builder-layout { display: grid; grid-template-columns: minmax(300px, .7fr) minmax(520px, 1.3fr); align-items: start; gap: 16px; }
.word-search-word-column { display: grid; min-width: 0; gap: 14px; }
.word-search-word-form-card, .word-search-word-list-card, .word-search-grid-card { padding: 17px; }
.word-search-word-form-card form { display: grid; gap: 12px; margin-top: 15px; }
.word-search-form-actions { display: flex; justify-content: flex-end; gap: 8px; }
.word-search-word-list-card > header, .word-search-grid-card > header { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.word-search-word-list-card h3, .word-search-word-list-card p, .word-search-grid-card h3, .word-search-grid-card p { margin: 0; }
.word-search-word-list-card header p, .word-search-grid-card header p { margin-top: 3px; color: var(--muted); font-size: .82rem; }
.word-search-word-list-card > header > span { display: grid; min-width: 34px; height: 30px; padding: 0 8px; place-items: center; color: var(--green-dark); background: #eaf7ed; border-radius: 999px; font-size: .78rem; }
.word-search-word-list { display: grid; max-height: 580px; gap: 8px; overflow-y: auto; padding-right: 3px; }
.word-search-word-item { padding: 11px; background: #fbfdfb; border: 1px solid var(--line); border-radius: 7px; }
.word-search-word-item.is-placed { border-color: #a7d2b1; }
.word-search-word-item.is-unplaced { background: #fffaf1; border-color: #ebd19a; }
.word-search-word-item > header { display: flex; align-items: center; gap: 9px; }
.word-search-word-item > header > span { display: grid; flex: 0 0 27px; width: 27px; height: 27px; place-items: center; color: #fff; background: var(--green); border-radius: 50%; font-size: .74rem; }
.word-search-word-item > header > div { display: grid; min-width: 0; flex: 1; gap: 2px; }
.word-search-word-item > header strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.word-search-word-item > header small { color: var(--muted); font-size: .74rem; }
.word-search-word-item > header em { color: var(--green-dark); font-size: .7rem; font-style: normal; }
.word-search-word-item.is-unplaced > header em { color: #9f630a; }
.word-search-word-item > p { display: flex; gap: 7px; margin: 9px 0 4px; color: var(--muted); font-size: .8rem; }
.word-search-word-item > footer { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; padding-top: 9px; border-top: 1px solid var(--line); }
.word-search-word-item > footer form { margin: 0; }
.word-search-empty, .word-search-grid-empty { display: grid; min-height: 150px; place-items: center; align-content: center; gap: 9px; color: var(--muted); text-align: center; }
.word-search-empty i { color: #8bbb98; font-size: 1.6rem; }
.word-search-empty p, .word-search-grid-empty h3, .word-search-grid-empty p { margin: 0; }
.word-search-grid-card { min-width: 0; }
.word-search-grid-card > header > div { max-width: 560px; }
.word-search-grid-scroll { max-width: 100%; overflow: auto; padding: 4px; border-radius: 8px; }
.word-search-grid { display: grid; width: max-content; grid-template-columns: repeat(10, 42px); grid-template-rows: repeat(10, 42px); gap: 3px; padding: 9px; background: #e3ebe5; border: 1px solid #cfdbd2; border-radius: 8px; }
.word-search-cell { display: grid; width: 42px; height: 42px; place-items: center; color: #263b2e; background: #fff; border: 1px solid #d5e0d8; border-radius: 5px; font-size: .9rem; font-weight: 600; }
.word-search-cell.is-placed { color: #07572f; background: #d9f3df; border-color: #74bc85; }
.word-search-placement-summary { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 14px; }
.word-search-placement-summary > section { padding: 12px; background: #f6fbf7; border: 1px solid #dce9df; border-radius: 8px; }
.word-search-placement-summary > section.is-warning { background: #fffaf1; border-color: #edd7a9; }
.word-search-placement-summary header { display: flex; align-items: center; gap: 8px; }
.word-search-placement-summary h4 { flex: 1; margin: 0; font-size: .9rem; }
.word-search-placement-summary header > span { display: grid; width: 25px; height: 25px; place-items: center; background: #e6f4e9; border-radius: 50%; font-size: .72rem; }
.word-search-placement-summary > section > div { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 10px; }
.word-search-placement-summary > section > div > span { display: grid; gap: 1px; padding: 6px 8px; background: #fff; border: 1px solid var(--line); border-radius: 6px; font-size: .76rem; }
.word-search-placement-summary small { color: var(--muted); font-size: .66rem; }
.word-search-grid-empty { min-height: 410px; padding: 30px; }
.word-search-grid-empty > span { display: grid; width: 58px; height: 58px; place-items: center; color: var(--green-dark); background: #e7f5ea; border-radius: 8px; font-size: 1.45rem; }
.word-search-grid-card > footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 15px; padding-top: 14px; border-top: 1px solid var(--line); }
.word-search-grid-card > footer > span { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: .78rem; }

@media (max-width: 1120px) {
  .word-search-builder-layout { grid-template-columns: 1fr; }
  .word-search-word-column { grid-template-columns: minmax(280px, .8fr) minmax(320px, 1.2fr); }
}

@media (max-width: 760px) {
  .word-search-builder-header, .word-search-settings-card > footer, .word-search-grid-card > header, .word-search-grid-card > footer, .word-search-publish-bar { display: grid; }
  .word-search-builder-header-actions, .word-search-publish-actions { width: 100%; flex-wrap: wrap; }
  .word-search-builder-header-actions .button, .word-search-publish-actions .button, .word-search-publish-actions form { flex: 1 1 auto; }
  .word-search-settings-grid, .word-search-word-column, .word-search-placement-summary { grid-template-columns: 1fr; }
  .word-search-field-wide { grid-column: auto; }
  .word-search-settings-card, .word-search-word-form-card, .word-search-word-list-card, .word-search-grid-card { padding: 13px; }
  .word-search-settings-card > footer .button, .word-search-grid-card > header .button, .word-search-grid-card > footer .button { justify-content: center; width: 100%; }
  .word-search-word-list { max-height: none; }
  .word-search-grid-scroll { width: 100%; overflow-x: auto; overscroll-behavior-x: contain; }
  .word-search-grid { grid-template-columns: repeat(10, 31px); grid-template-rows: repeat(10, 31px); gap: 2px; padding: 6px; }
  .word-search-cell { width: 31px; height: 31px; font-size: .75rem; }
  .word-search-grid-empty { min-height: 250px; }
}
