/* Ustaad-X v0.11 — reversible student-specific adaptive teaching */

.v11-two-column,
.v11-master-detail {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  align-items: start;
  margin-bottom: 18px;
}

.v11-master-detail {
  grid-template-columns: minmax(270px, .72fr) minmax(0, 1.6fr);
}

.v11-form-grid,
.v11-setting-grid,
.v11-foundation-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.v11-setting-grid { margin: 14px 0; }

.v11-setting {
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fbfdfc;
}

.v11-setting small,
.v11-foundation-card small {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 850;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.v11-setting strong,
.v11-foundation-card strong { color: var(--navy); font-size: 13px; }

.v11-foundation-card {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}

.v11-foundation-meter {
  height: 7px;
  margin: 9px 0 6px;
  overflow: hidden;
  border-radius: 999px;
  background: #e8efec;
}

.v11-foundation-meter > span {
  display: block;
  height: 100%;
  width: var(--v11-score, 50%);
  border-radius: inherit;
  background: linear-gradient(90deg, var(--yellow), var(--teal));
}

.v11-foundation-card p { margin: 0; color: var(--muted); font-size: 10px; }

.v11-card-list,
.v11-timeline {
  display: grid;
  gap: 11px;
}

.v11-card,
.v11-timeline-item {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 6px 18px rgba(17, 45, 56, .045);
}

.v11-card-head,
.v11-timeline-head,
.v11-adaptation-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.v11-card h3,
.v11-card h4,
.v11-timeline-item h4 { margin: 0; color: var(--navy); }
.v11-card p,
.v11-timeline-item p { color: var(--muted); line-height: 1.52; }

.v11-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 9px;
}

.v11-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 8px;
  border-radius: 999px;
  background: var(--mint);
  color: var(--teal-dark);
  font-size: 9px;
  font-weight: 850;
  letter-spacing: .025em;
}

.v11-chip.warning { background: #fff2cf; color: #735710; }
.v11-chip.neutral { background: #eef2f1; color: #44545a; }
.v11-chip.active { background: #e5f4ed; color: #14653d; }
.v11-chip.rejected { background: #fee9e8; color: #913d38; }

.v11-change-list {
  display: grid;
  gap: 7px;
  margin: 10px 0;
}

.v11-change {
  padding: 9px 10px;
  border-left: 3px solid var(--teal);
  border-radius: 7px;
  background: #f5faf8;
  color: #3d5057;
  font-size: 11px;
  line-height: 1.45;
}

.v11-lesson-adaptation {
  margin: 0 0 18px;
  padding: 16px 18px;
  border: 1px solid rgba(13, 118, 110, .25);
  border-left: 5px solid var(--teal);
  border-radius: 16px;
  background: linear-gradient(120deg, rgba(223, 243, 237, .75), #fff 62%);
  box-shadow: var(--shadow-small);
}

.v11-adaptation-head small {
  color: var(--teal);
  font-size: 9px;
  font-weight: 900;
  letter-spacing: .12em;
}

.v11-adaptation-head h3 { margin: 5px 0 3px; color: var(--navy); font-size: 18px; }
.v11-adaptation-head p { margin: 0; color: var(--muted); font-size: 10px; }
.v11-adaptation-head label { min-width: 190px; font-size: 10px; }
.v11-adaptation-head select { margin-top: 4px; }

.v11-feedback-row {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin: 13px 0 8px;
}

.v11-feedback-row button {
  border: 1px solid rgba(13, 118, 110, .24);
  border-radius: 999px;
  background: #fff;
  color: var(--teal-dark);
  padding: 7px 10px;
  font-size: 10px;
  font-weight: 800;
  cursor: pointer;
}

.v11-feedback-row button:hover,
.v11-feedback-row button:focus-visible {
  border-color: var(--teal);
  background: var(--mint);
  outline: none;
}

.v11-feedback-row button:disabled { opacity: .58; cursor: progress; }

.v11-timeline-item { position: relative; padding-left: 42px; }
.v11-timeline-item::before {
  content: attr(data-version);
  position: absolute;
  left: 12px;
  top: 13px;
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--navy);
  color: #fff;
  font-size: 9px;
  font-weight: 900;
}
.v11-timeline-item.is-active { border-color: rgba(13, 118, 110, .4); background: #f9fdfb; }

.v11-evidence-line {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
}
.v11-evidence-line:last-child { border-bottom: 0; }
.v11-evidence-line span { color: #354a52; font-size: 11px; }
.v11-evidence-line strong { color: var(--teal-dark); font-size: 11px; }

.v11-review-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}
.v11-review-actions textarea { flex: 1 1 280px; min-height: 64px; }

.v11-empty-note {
  padding: 14px;
  border: 1px dashed var(--line);
  border-radius: 12px;
  color: var(--muted);
  text-align: center;
  font-size: 11px;
}

.v11-admin-student-button,
.v11-tutor-student-button {
  width: 100%;
  text-align: left;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  padding: 12px;
  cursor: pointer;
}
.v11-admin-student-button:hover,
.v11-tutor-student-button:hover,
.v11-admin-student-button.active,
.v11-tutor-student-button.active { border-color: var(--teal); background: #f7fcfa; }
.v11-admin-student-button strong,
.v11-tutor-student-button strong { display: block; color: var(--navy); }
.v11-admin-student-button small,
.v11-tutor-student-button small { color: var(--muted); }

body.v11-larger-text { font-size: 18px; }
body.v11-larger-text .fine-print,
body.v11-larger-text small { font-size: .78rem; }
body.v11-high-contrast { filter: contrast(1.18); }
body.v11-reduced-motion *,
body.v11-reduced-motion *::before,
body.v11-reduced-motion *::after { scroll-behavior: auto !important; animation-duration: .001ms !important; transition-duration: .001ms !important; }
body.v11-dyslexia-spacing .teaching-card-body,
body.v11-dyslexia-spacing .message-content,
body.v11-dyslexia-spacing .lecture-caption-bar { letter-spacing: .035em; word-spacing: .11em; line-height: 1.75; }

@media (max-width: 980px) {
  .v11-two-column,
  .v11-master-detail { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .v11-form-grid,
  .v11-setting-grid,
  .v11-foundation-grid { grid-template-columns: 1fr; }
  .v11-adaptation-head label { width: 100%; }
}
