/* واجهات النظري فقط. الألوان والخطوط الأساسية مشتركة مع LABVERSE. */
:root {
  --theory-mint: #cbe4d6;
  --theory-lilac: #d9d1f1;
}
[hidden] {
  display: none !important;
}
.theory-page {
  max-width: 1280px;
  margin: auto;
  padding: 0 5% 65px;
}
.theory-topbar .brand {
  text-decoration: none;
}
.theory-topbar nav {
  flex-wrap: wrap;
  justify-content: flex-end;
}
.theory-topbar nav a {
  text-decoration: none;
}
.theory-topbar nav a:hover {
  text-decoration: underline;
}
.breadcrumb {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  padding: 23px 0;
  font-size: 10px;
  color: #545b64;
}
.breadcrumb a {
  text-decoration: none;
}
.breadcrumb a:hover {
  text-decoration: underline;
}
.theory-hero {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 40px;
  align-items: center;
  padding: 32px 0 50px;
}
.theory-hero h1 {
  font-size: clamp(32px, 4.4vw, 59px);
  line-height: 1.7;
  font-weight: 900;
  margin: 10px 0 18px;
  letter-spacing: -1.5px;
}
.theory-hero h1 em {
  font-style: normal;
  background: linear-gradient(
    transparent 58%,
    var(--yellow) 58%,
    var(--yellow) 90%,
    transparent 90%
  );
}
.theory-hero p {
  color: #545b64;
  font-size: 14px;
  max-width: 620px;
}
.issue-label {
  display: inline-block;
  background: var(--ink);
  color: var(--paper);
  font: 700 11px monospace;
  padding: 8px 13px;
  transform: rotate(2deg);
}
.theory-cover {
  min-height: 310px;
  position: relative;
  display: grid;
  place-items: center;
  border: 3px solid var(--ink);
  box-shadow: 8px 8px var(--ink);
  transform: rotate(-2deg);
  background: var(--yellow);
  background-image: radial-gradient(#19212b36 1px, transparent 1px);
  background-size: 7px 7px;
  overflow: hidden;
}
.theory-cover::before {
  content: "✦";
  position: absolute;
  top: -50px;
  left: 8px;
  font-size: 160px;
  color: var(--red);
  -webkit-text-stroke: 2px var(--ink);
}
.theory-cover .cover-word {
  font:
    italic 900 clamp(40px, 6vw, 68px)/0.96 "AWAPHs Arabic", Arial,
    sans-serif;
  color: var(--blue);
  text-shadow: 3px 3px white;
  transform: rotate(-8deg);
  z-index: 1;
}
.cover-caption {
  position: absolute;
  bottom: 0;
  right: 0;
  left: 0;
  text-align: center;
  background: var(--paper);
  border-top: 2px solid var(--ink);
  padding: 10px;
  font-size: 11px;
}
.book-stack {
  position: absolute;
  right: 23px;
  top: 22px;
  display: grid;
  gap: 5px;
  transform: rotate(12deg);
  animation: book-float 4s ease-in-out infinite;
}
.book-stack i {
  width: 65px;
  height: 18px;
  display: block;
  border: 2px solid var(--ink);
  background: var(--red);
  box-shadow: 3px 3px var(--ink);
}
.book-stack i:nth-child(2) {
  background: var(--blue);
  transform: translateX(7px);
}
.book-stack i:nth-child(3) {
  background: var(--theory-mint);
}
@keyframes book-float {
  50% {
    transform: translateY(7px) rotate(7deg);
  }
}
.subject-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 23px;
  margin: 20px 0 45px;
}
.subject-card {
  display: flex;
  flex-direction: column;
  border: 2px solid var(--ink);
  box-shadow: 5px 5px var(--ink);
  background: #fffcf4;
  color: var(--ink);
  text-decoration: none;
  transition:
    transform 0.2s,
    box-shadow 0.2s;
  overflow: hidden;
}
a.subject-card:hover {
  transform: translate(-2px, -4px);
  box-shadow: 7px 9px var(--ink);
}
.subject-card .subject-art {
  min-height: 155px;
  position: relative;
  display: grid;
  place-items: center;
  background: var(--card-color, var(--yellow));
  border-bottom: 2px solid var(--ink);
  background-image: radial-gradient(#19212b30 1px, transparent 1px);
  background-size: 7px 7px;
}
.subject-symbol {
  font: 900 62px "AWAPHs Arabic", Arial;
  transform: rotate(-8deg);
  text-shadow: 3px 3px white;
}
.subject-state {
  position: absolute;
  right: 12px;
  top: 12px;
  border: 1px solid var(--ink);
  background: #fffdf6;
  padding: 4px 9px;
  font-size: 9px;
}
.subject-body {
  padding: 23px;
  flex: 1;
  display: flex;
  flex-direction: column;
}
.subject-body small {
  font: 10px monospace;
  color: #555d69;
  letter-spacing: 1px;
}
.subject-body h2 {
  font-size: 21px;
  margin: 8px 0;
}
.subject-body p {
  font-size: 11px;
  color: #545b64;
  margin-bottom: 18px;
}
.subject-body .subject-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px solid #19212b35;
  font-size: 11px;
  font-weight: 700;
}
.subject-body .subject-link b {
  font: 25px "AWAPHs Arabic", Arial;
}
.subject-card.coming {
  box-shadow: 3px 3px #19212b70;
}
.learning-strip {
  border: 2px solid var(--ink);
  background: var(--theory-mint);
  padding: 23px;
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  justify-content: space-between;
  margin: 20px 0 35px;
  font-size: 12px;
}
.learning-strip span {
  display: flex;
  align-items: center;
  gap: 10px;
}
.learning-strip b {
  font: 900 27px "AWAPHs Arabic", Arial;
}
.lecture-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 25px;
  margin: 20px 0 40px;
}
.lecture-card {
  display: grid;
  grid-template-columns: 100px 1fr;
  background: #fffdf7;
  border: 2px solid var(--ink);
  box-shadow: 5px 5px var(--ink);
  overflow: hidden;
}
.lecture-spine {
  background: var(--card-color, var(--yellow));
  border-left: 2px solid var(--ink);
  display: grid;
  place-items: center;
  font: 900 58px "AWAPHs Arabic", Arial;
  background-image: radial-gradient(#19212b32 1px, transparent 1px);
  background-size: 6px 6px;
}
.lecture-body {
  padding: 27px;
}
.lecture-body h2 {
  font-size: 23px;
  margin-bottom: 12px;
}
.lecture-body p {
  font-size: 12px;
  color: #545b64;
}
.lecture-body .primary {
  margin-top: 15px;
}
.saved-progress {
  margin-top: 18px;
  font-size: 10px;
  border-top: 1px solid #19212b35;
  padding-top: 12px;
}
.lesson-header {
  padding: 20px 0 22px;
}
.lesson-header .lesson-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}
.lesson-header h1 {
  font-size: clamp(27px, 4vw, 45px);
  margin: 20px 0 10px;
  font-weight: 900;
}
.lesson-header .lead {
  color: #545b64;
  font-size: 14px;
}
.lesson-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
  align-items: center;
  font-size: 10px;
  margin-top: 19px;
}
.lesson-meta a {
  color: var(--blue);
  font-weight: 700;
}
.lesson-meta .progress-chip {
  background: var(--yellow);
  border: 1px solid var(--ink);
  padding: 7px 10px;
}
.text-button {
  text-decoration: underline;
  text-underline-offset: 4px;
  padding: 10px 3px;
  font-size: 11px;
}
.lesson-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  border-top: 2px solid var(--ink);
  border-bottom: 2px solid var(--ink);
  padding: 15px 0;
  margin: 0 0 29px;
}
.lesson-tabs button {
  border: 1px solid var(--ink);
  background: #fffdf7;
  padding: 10px 15px;
  font-size: 11px;
  font-weight: 700;
  transition:
    background 0.2s,
    transform 0.2s;
}
.lesson-tabs button:hover {
  background: var(--yellow);
  transform: translateY(-2px);
}
.lesson-tabs button.active {
  color: white;
  background: var(--blue);
  box-shadow: 3px 3px var(--ink);
}
.mini-count {
  background: var(--yellow);
  border-radius: 50%;
  color: var(--ink);
  display: inline-grid;
  place-items: center;
  min-width: 20px;
  height: 20px;
  font: 700 11px "AWAPHs Arabic", Arial;
}
#lesson-content {
  scroll-margin-top: 20px;
  min-height: 450px;
}
#lesson-content:focus {
  outline: none;
}
.learn-layout {
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
  gap: 26px;
  align-items: start;
}
.chapter-list {
  display: grid;
  gap: 8px;
}
.chapter-list button {
  display: flex;
  align-items: center;
  gap: 10px;
  text-align: right;
  font-size: 10px;
  line-height: 1.9;
  padding: 12px;
  background: #eae6dc;
  border: 1px solid transparent;
}
.chapter-list button span {
  font: 700 16px "AWAPHs Arabic", Arial;
  color: #606672;
}
.chapter-list button b {
  margin-inline-start: auto;
  color: #245c45;
}
.chapter-list button.selected {
  border: 2px solid var(--ink);
  box-shadow: 3px 3px var(--ink);
  background: var(--yellow);
}
.chapter-list button:hover {
  background: #fffdf7;
  border-color: var(--ink);
}
.lesson-panel {
  background: #fffdf7;
  border: 2px solid var(--ink);
  box-shadow: 5px 5px var(--ink);
  padding: 30px;
  min-width: 0;
}
.lesson-panel h2 {
  font-size: 26px;
}
.lesson-panel .lead {
  font-size: 13px;
  color: #545b64;
}
.comic-scene {
  border: 2px solid var(--ink);
  margin: 25px 0;
  background: #d9e5f2;
  background-image: radial-gradient(#284dbb29 1px, transparent 1px);
  background-size: 7px 7px;
  overflow: hidden;
}
.scene-top {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  background: var(--yellow);
  border-bottom: 2px solid var(--ink);
  padding: 9px 15px;
  font-size: 10px;
}
.scene-top span {
  font-size: 9px;
}
.mechanism {
  display: block;
  width: 100%;
  max-width: 540px;
  margin: auto;
  height: 260px;
}
.neuron {
  fill: #fffdf5;
  stroke: var(--ink);
  stroke-width: 3;
}
.neuron.bottom {
  fill: var(--theory-mint);
}
.mechanism text {
  font: 700 12px "AWAPHs Arabic", Arial;
  fill: var(--ink);
}
.molecule-dot {
  fill: var(--red);
  stroke: var(--ink);
  stroke-width: 1.5;
  animation: transmit 2.8s infinite;
  animation-delay: var(--delay);
}
@keyframes transmit {
  0% {
    transform: translateY(-15px);
    opacity: 0.4;
  }
  50% {
    transform: translateY(49px);
    opacity: 1;
  }
  100% {
    transform: translateY(-15px);
    opacity: 0.4;
  }
}
.return-path {
  stroke: var(--blue);
  fill: none;
  stroke-width: 4;
  stroke-dasharray: 7 4;
  animation: signal-flow 1s linear infinite;
}
@keyframes signal-flow {
  to {
    stroke-dashoffset: 22;
  }
}
.receptor-shape {
  fill: var(--yellow);
  stroke: var(--ink);
  stroke-width: 3;
}
.drug-piece {
  opacity: 0;
  transform: translateY(-40px);
  transition:
    transform 0.8s,
    opacity 0.6s;
}
.drug-piece path {
  fill: var(--red);
  stroke: var(--ink);
  stroke-width: 2;
}
.drug-piece text {
  fill: white;
  font-size: 13px;
}
.gate-cross {
  opacity: 0;
}
.gate-cross path {
  stroke: var(--red);
  stroke-width: 9;
  stroke-linecap: round;
}
.signal-line {
  stroke: var(--red);
  stroke-width: 3;
  stroke-dasharray: 5 9;
  opacity: 0.4;
}
.effect-label {
  font: 900 25px "AWAPHs Arabic", Arial !important;
  fill: var(--blue) !important;
}
.block.phase-1 .gate-cross,
.block.phase-2 .gate-cross {
  opacity: 1;
}
.block.phase-1 .return-path,
.block.phase-2 .return-path {
  opacity: 0.15;
  animation: none;
}
.block.phase-1 .molecule-dot,
.block.phase-2 .molecule-dot {
  animation: linger 2s infinite;
  animation-delay: var(--delay);
}
@keyframes linger {
  0%,
  100% {
    transform: translateY(42px) translateX(-8px);
  }
  50% {
    transform: translateY(55px) translateX(8px);
  }
}
.release.phase-1 .molecule-dot,
.release.phase-2 .molecule-dot {
  animation-duration: 1.3s;
}
.inhibit.phase-1 .molecules,
.inhibit.phase-2 .molecules {
  opacity: 0.15;
}
.inhibit.phase-1 .signal-line,
.inhibit.phase-2 .signal-line {
  stroke-dasharray: 2 26;
  opacity: 0.2;
}
.receptor .return-path,
.receptor .molecules {
  opacity: 0;
}
.receptor .drug-piece {
  opacity: 1;
  animation: bind-drug 3s ease-in-out infinite;
}
@keyframes bind-drug {
  0%,
  100% {
    transform: translateY(-42px);
  }
  55%,
  75% {
    transform: translateY(0);
  }
}
.receptor.phase-0 .drug-piece {
  animation: none;
  transform: translateY(-42px);
}
.receptor.phase-2 .drug-piece {
  animation: none;
  transform: translateY(0);
}
.receptor.phase-2 .receptor-shape {
  fill: var(--red);
}
.flow-scene {
  min-height: 260px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 20px;
  gap: 12px;
}
.flow-stop {
  position: relative;
  width: 85%;
  max-width: 400px;
  margin: auto;
  display: flex;
  gap: 13px;
  align-items: center;
  background: #fffdf7;
  border: 2px solid var(--ink);
  padding: 10px 14px;
  opacity: 0.5;
  transition:
    transform 0.4s,
    background 0.4s,
    opacity 0.4s;
}
.flow-stop span {
  font: 900 23px "AWAPHs Arabic", Arial;
}
.flow-stop b {
  font-size: 12px;
}
.flow-stop i {
  position: absolute;
  bottom: -20px;
  left: 18px;
  z-index: 1;
  font: 900 28px "AWAPHs Arabic", Arial;
  color: var(--red);
}
.flow-stop.current {
  opacity: 1;
  background: var(--yellow);
  box-shadow: 4px 4px var(--ink);
  transform: translateX(-7px);
}
.flow-stop.current i {
  animation: arrow-step 1s ease-in-out infinite;
}
.flow-stop.passed {
  opacity: 1;
  background: var(--theory-mint);
}
@keyframes arrow-step {
  50% {
    transform: translateY(3px);
  }
}
.scene-caption {
  padding: 15px 20px;
  border-top: 2px solid var(--ink);
  background: #fffdf7;
  min-height: 110px;
}
.scene-caption strong {
  font-size: 13px;
}
.scene-caption p {
  margin: 5px 0 0;
  font-size: 12px;
}
.phase-controls {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border-top: 2px solid var(--ink);
}
.phase-controls button {
  padding: 12px 8px;
  border-left: 1px solid var(--ink);
  font: 900 18px "AWAPHs Arabic", Arial;
  background: #e8e4d9;
}
.phase-controls button:last-child {
  border-left: none;
}
.phase-controls button span {
  font:
    10px/1.9 "IBM Plex Sans Arabic",
    Tahoma,
    sans-serif;
  display: block;
  margin-top: 5px;
}
.phase-controls button.active {
  background: var(--blue);
  color: white;
}
.key-points {
  padding-inline-start: 22px;
  font-size: 13px;
  line-height: 2.2;
}
.key-points li {
  padding: 5px 3px;
  margin-bottom: 6px;
}
.key-points li::marker {
  color: var(--red);
}
.takeaway {
  border: 2px solid var(--ink);
  padding: 17px 20px;
  background: var(--yellow);
  transform: rotate(-0.4deg);
  margin: 25px 0 15px;
}
.takeaway b {
  font-size: 11px;
}
.takeaway p {
  font-size: 13px;
  margin: 8px 0 0;
}
.source-line {
  font-size: 10px;
  line-height: 2;
  color: #555d69;
  margin: 15px 0;
}
.source-line a {
  color: var(--blue);
  font-weight: 700;
  white-space: nowrap;
}
.external-note {
  background: #ede8fa;
  border: 1px solid #74648f;
  border-inline-start: 5px solid #74648f;
  padding: 17px;
  margin: 18px 0;
  font-size: 11px;
}
.external-note strong {
  display: inline-block;
  background: #5e467c;
  color: white;
  padding: 3px 8px;
  font-size: 9px;
}
.external-note p {
  margin: 9px 0;
}
.external-note a {
  color: #4c3868;
  font-weight: 700;
}
.action-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 13px;
  margin: 25px 0 4px;
}
.centered {
  justify-content: center;
  text-align: center;
}
.section-intro {
  margin: 0 0 30px;
  max-width: 820px;
}
.section-intro h2 {
  font-size: 30px;
  font-weight: 900;
  margin-bottom: 10px;
}
.section-intro p {
  font-size: 13px;
  color: #545b64;
}
.concept-map {
  display: grid;
  grid-template-columns: 1.25fr 1fr;
  gap: 25px;
  align-items: start;
}
.map-center {
  grid-column: 1 / -1;
  display: flex;
  gap: 18px;
  align-items: center;
  justify-content: center;
  max-width: 520px;
  width: 100%;
  margin: auto;
  background: var(--yellow);
  border: 3px solid var(--ink);
  box-shadow: 5px 5px var(--ink);
  padding: 25px;
  font-size: 32px;
  position: relative;
}
.map-center::after {
  content: "";
  height: 25px;
  width: 2px;
  position: absolute;
  bottom: -27px;
  left: 50%;
  background: var(--ink);
}
.map-center strong {
  font-size: 22px;
}
.map-branches {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  border-top: 2px solid var(--ink);
  padding-top: 20px;
}
.map-branches button {
  background: #fffdf7;
  border: 2px solid var(--ink);
  padding: 18px 12px;
  font: 700 12px/1.7 "AWAPHs Arabic", Arial;
  min-height: 65px;
  box-shadow: 3px 3px var(--ink);
  transition: transform 0.2s;
}
.map-branches button:hover {
  transform: translateY(-3px);
}
.map-branches button.active {
  background: var(--blue);
  color: white;
}
.map-detail {
  background: var(--theory-mint);
  border: 2px solid var(--ink);
  padding: 28px;
  margin-top: 20px;
  position: sticky;
  top: 20px;
}
.map-detail h3 {
  font: 900 24px/1.5 "AWAPHs Arabic", Arial;
}
.map-detail p {
  font-size: 14px;
}
.comparison-panel {
  margin: 30px 0;
}
.comparison-panel h3 {
  font-size: 20px;
}
.table-scroll {
  overflow-x: auto;
  border: 2px solid var(--ink);
  background: #fffdf7;
  box-shadow: 4px 4px var(--ink);
}
.table-scroll table {
  width: 100%;
  min-width: 630px;
  border-collapse: collapse;
}
.table-scroll th,
.table-scroll td {
  border: 1px solid #19212b55;
  padding: 15px;
  vertical-align: top;
  min-width: 150px;
}
.table-scroll th {
  background: var(--yellow);
  font-size: 12px;
  text-align: right;
}
.table-scroll th[scope="row"] {
  background: #e6e3dc;
  max-width: 180px;
}
.table-scroll th[scope="col"] {
  font-weight: 800;
}
.recall-input {
  width: 100%;
  background: transparent;
  border: 0;
  border-bottom: 1px dashed #737778;
  padding: 8px 0;
  font:
    11px "IBM Plex Sans Arabic",
    Tahoma,
    sans-serif;
}
.reveal-button {
  color: var(--blue);
  font-size: 10px;
  padding: 12px 0;
  text-decoration: underline;
}
.cell-answer {
  font-size: 12px;
  line-height: 2;
  margin: 5px 0;
  animation: reveal-answer 0.2s ease-out;
}
@keyframes reveal-answer {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
.segmented {
  display: inline-flex;
  border: 2px solid var(--ink);
  background: #fffdf7;
}
.segmented button {
  padding: 10px 17px;
  font-size: 11px;
}
.segmented button[aria-pressed="true"] {
  background: var(--blue);
  color: white;
}
.flashcard {
  max-width: 720px;
  min-height: 320px;
  margin: 30px auto;
  padding: 40px;
  background: var(--yellow);
  border: 3px solid var(--ink);
  box-shadow: 9px 9px var(--ink);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  animation: card-in 0.3s ease-out;
}
.flashcard.flipped {
  background: var(--theory-mint);
  animation: card-reveal 0.3s ease-out;
}
.flashcard h3 {
  font-size: 23px;
  margin: 15px 0 25px;
}
@keyframes card-reveal {
  from {
    transform: perspective(900px) rotateY(-16deg);
    opacity: 0.5;
  }
  to {
    transform: perspective(900px) rotateY(0);
    opacity: 1;
  }
}
@keyframes card-in {
  from {
    transform: perspective(900px) rotateY(16deg);
    opacity: 0.5;
  }
  to {
    transform: perspective(900px) rotateY(0);
    opacity: 1;
  }
}
.quiet {
  font-size: 10px;
  line-height: 2;
  color: #5a6169;
}
.quiz-welcome,
.question-panel,
.results-panel {
  max-width: 850px;
  margin: 20px auto;
  padding: 38px;
  border: 2px solid var(--ink);
  box-shadow: 6px 6px var(--ink);
  background: #fffdf7;
}
.quiz-welcome {
  position: relative;
  padding-top: 70px;
}
.quiz-welcome h2 {
  font-size: 29px;
}
.quiz-welcome p {
  font-size: 13px;
}
.quiz-welcome .quiet {
  font-size: 10px;
}
.burst {
  display: block;
  position: absolute;
  top: -15px;
  left: 22px;
  background: var(--yellow);
  border: 2px solid var(--ink);
  box-shadow: 3px 3px var(--ink);
  font: italic 900 23px "AWAPHs Arabic", Arial;
  padding: 12px;
  transform: rotate(-7deg);
}
.best-score {
  margin: 25px 0 0;
  color: var(--blue);
  font-weight: 700;
}
.question-top {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 11px;
}
.question-panel progress {
  display: block;
  width: 100%;
  height: 8px;
  border: 0;
  margin: 15px 0 28px;
  accent-color: var(--red);
  background: #e0dccc;
}
.question-panel progress::-webkit-progress-bar {
  background: #e0dccc;
}
.question-panel progress::-webkit-progress-value {
  background: var(--red);
}
.question-panel fieldset {
  border: 0;
  padding: 0;
  margin: 0;
  min-width: 0;
}
.question-panel legend {
  font-size: 19px;
  font-weight: 800;
  line-height: 1.9;
  margin-bottom: 23px;
}
.choice-list {
  display: grid;
  gap: 12px;
}
.choice {
  display: flex;
  align-items: center;
  gap: 13px;
  border: 2px solid #19212b75;
  padding: 14px 16px;
  cursor: pointer;
  font-size: 12px;
  background: var(--paper);
  transition:
    transform 0.15s,
    background 0.15s;
}
.choice:has(input:checked) {
  background: var(--yellow);
  border-color: var(--ink);
  box-shadow: 3px 3px var(--ink);
}
.choice:has(input:focus-visible) {
  outline: 3px solid var(--blue);
  outline-offset: 3px;
}
.choice input {
  width: 19px;
  height: 19px;
  flex: none;
  accent-color: var(--blue);
}
.question-panel fieldset:disabled {
  opacity: 0.8;
}
.question-panel fieldset:disabled .choice {
  cursor: default;
}
.question-error {
  color: #9c2424;
  font-size: 12px;
  margin: 16px 0;
}
.question-origin {
  margin: 25px 0 0;
  border-top: 1px solid #19212b35;
  padding-top: 15px;
}
.order-list {
  padding: 0;
  list-style: none;
  display: grid;
  gap: 10px;
}
.order-list li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px;
  border: 2px solid var(--ink);
  background: var(--paper);
  font-size: 11px;
}
.order-list li b {
  font: 900 22px "AWAPHs Arabic", Arial;
  color: var(--blue);
}
.order-list li span {
  flex: 1;
}
.order-list button {
  background: var(--yellow);
  border: 1px solid var(--ink);
  padding: 8px;
  font-size: 10px;
  white-space: nowrap;
}
.match-list {
  display: grid;
  gap: 15px;
}
.match-list label {
  display: grid;
  grid-template-columns: 1fr 1.5fr;
  align-items: center;
  gap: 17px;
  font-size: 13px;
}
.match-list select {
  min-width: 0;
  width: 100%;
  background: var(--paper);
  border: 2px solid var(--ink);
  padding: 12px;
  font-size: 11px;
}
.answer-feedback {
  border: 2px solid var(--ink);
  padding: 22px;
  margin: 25px 0;
  animation: reveal-answer 0.25s ease-out;
}
.answer-feedback.is-correct {
  background: #dcebdc;
  border-color: #306649;
}
.answer-feedback.is-wrong {
  background: #fbe2d8;
  border-color: #9c4739;
}
.answer-feedback h3 {
  font-size: 18px;
}
.answer-feedback p {
  font-size: 12px;
  overflow-wrap: anywhere;
}
.results-panel {
  text-align: center;
}
.score-number {
  font: 900 105px/1.6 "AWAPHs Arabic", Arial;
  color: var(--blue);
}
.score-number small {
  font-size: 38px;
}
.results-panel p {
  font-size: 13px;
}
.empty-panel {
  border: 2px dashed #7b817d;
  padding: 30px;
  text-align: center;
  background: #edece2;
}
.empty-panel > span {
  font: 900 45px "AWAPHs Arabic", Arial;
  color: var(--blue);
}
.empty-panel h3 {
  margin: 13px 0;
}
.empty-panel p {
  margin: 0;
  font-size: 12px;
}
.mistakes-grid {
  display: grid;
  gap: 13px;
}
.mistake-card {
  background: #fffdf7;
  border: 2px solid var(--ink);
  padding: 20px;
}
.mistake-card summary {
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
  line-height: 2;
}
.mistake-card p {
  font-size: 12px;
}
.personal-note {
  margin: 35px 0;
  padding: 25px;
  background: var(--yellow);
  border: 2px solid var(--ink);
}
.personal-note textarea {
  width: 100%;
  border: 2px solid var(--ink);
  padding: 17px;
  font:
    12px/2 "IBM Plex Sans Arabic",
    Tahoma,
    sans-serif;
  background: #fffdf7;
  color: var(--ink);
  resize: vertical;
}
.personal-note h3 {
  margin-bottom: 10px;
}
.learning-notice {
  font-size: 10px;
  color: #545b64;
  padding-top: 20px;
  margin-top: 35px;
  border-top: 1px solid #19212b35;
}
.storage-status {
  font-size: 9px;
  color: #626872;
  margin-top: 12px;
}
.theory-footer {
  padding: 25px 5%;
  max-width: 1280px;
}
.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;
}
input:focus-visible,
textarea:focus-visible {
  outline: 3px solid var(--blue);
  outline-offset: 3px;
}
.motion-paused * {
  animation-play-state: paused !important;
  transition: none !important;
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}
@media (max-width: 1000px) {
  .subject-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .learn-layout {
    grid-template-columns: 205px minmax(0, 1fr);
    gap: 18px;
  }
  .lesson-panel {
    padding: 23px;
  }
  .lecture-card {
    grid-template-columns: 65px 1fr;
  }
  .lecture-spine {
    font-size: 40px;
  }
  .lecture-body {
    padding: 22px;
  }
}
@media (max-width: 740px) {
  .theory-page {
    padding: 0 20px 40px;
  }
  .theory-topbar {
    gap: 12px;
  }
  .theory-topbar nav {
    font-size: 9px;
    gap: 12px;
  }
  .theory-hero {
    grid-template-columns: 1fr;
    gap: 25px;
    padding-top: 12px;
  }
  .theory-hero h1 {
    font-size: 36px;
  }
  .theory-cover {
    min-height: 245px;
  }
  .theory-cover .cover-word {
    font-size: 58px;
  }
  .subject-grid {
    gap: 15px;
  }
  .subject-card .subject-art {
    min-height: 130px;
  }
  .subject-body {
    padding: 17px;
  }
  .subject-body h2 {
    font-size: 17px;
  }
  .subject-body p {
    font-size: 10px;
  }
  .lecture-grid {
    grid-template-columns: 1fr;
  }
  .learn-layout {
    grid-template-columns: 1fr;
  }
  .chapter-list {
    display: flex;
    overflow-x: auto;
    gap: 10px;
    padding: 3px 3px 10px;
  }
  .chapter-list button {
    flex: 0 0 185px;
    font-size: 10px;
  }
  .lesson-panel {
    padding: 20px;
  }
  .lesson-panel h2 {
    font-size: 23px;
  }
  .key-points {
    font-size: 12px;
  }
  .lesson-tabs {
    gap: 8px;
  }
  .lesson-tabs button {
    padding: 10px;
    font-size: 10px;
    flex: 1 0 auto;
  }
  .concept-map {
    grid-template-columns: 1fr;
  }
  .map-detail {
    margin: 0;
    position: static;
  }
  .section-intro h2 {
    font-size: 26px;
  }
  .question-panel,
  .quiz-welcome,
  .results-panel {
    padding: 23px;
  }
  .quiz-welcome {
    padding-top: 65px;
  }
  .quiz-welcome h2 {
    font-size: 24px;
  }
  .question-panel legend {
    font-size: 16px;
  }
  .order-list li {
    flex-wrap: wrap;
  }
  .order-list li span {
    flex-basis: 75%;
  }
  .match-list label {
    grid-template-columns: 1fr;
    gap: 7px;
  }
  .flashcard {
    padding: 25px;
    min-height: 300px;
  }
  .flashcard h3 {
    font-size: 19px;
  }
  .theory-footer {
    margin: 0 20px;
    padding: 25px 0;
  }
  .learning-strip {
    gap: 18px;
    font-size: 10px;
  }
}
@media (max-width: 410px) {
  .subject-grid {
    grid-template-columns: 1fr;
  }
  .subject-card {
    display: grid;
    grid-template-columns: 95px 1fr;
  }
  .subject-card .subject-art {
    border-bottom: 0;
    border-left: 2px solid var(--ink);
    height: 100%;
  }
  .subject-symbol {
    font-size: 38px;
  }
  .subject-state {
    top: 9px;
    right: 5px;
    left: 5px;
    font-size: 7px;
    text-align: center;
    padding: 3px;
  }
  .phase-controls button span {
    font-size: 9px;
  }
  .scene-top {
    font-size: 9px;
  }
  .scene-top span {
    font-size: 8px;
  }
  .lesson-panel {
    padding: 16px;
  }
  .map-branches {
    grid-template-columns: 1fr;
  }
}
/* مشاهد تنافس على المستقبل: تختلف عن حركة نواقل إعادة الالتقاط. */
.binding-story {
  max-width: 540px;
  margin: auto;
}
.binding-story svg {
  display: block;
  width: 100%;
  height: 245px;
}
.binding-story text {
  font:
    700 13px "AWAPHs Arabic", Arial,
    sans-serif;
  fill: var(--ink);
}
.binding-membrane {
  fill: var(--theory-mint);
  stroke: var(--ink);
  stroke-width: 3;
}
.binding-receptor {
  fill: var(--yellow);
  stroke: var(--ink);
  stroke-width: 3;
}
.original-ligand circle {
  fill: #538d6f;
  stroke: var(--ink);
  stroke-width: 2;
}
.competing-ligand rect {
  fill: var(--red);
  stroke: var(--ink);
  stroke-width: 2;
}
.binding-label {
  font-size: 11px;
  text-align: center;
  padding: 0 14px;
  margin: 0 0 15px;
}
.binding-signal {
  fill: none;
  stroke: var(--blue);
  stroke-width: 3;
  stroke-dasharray: 5 3;
  animation: signal-flow 1s linear infinite;
}
.binding-phase-1 .original-ligand {
  animation: displace-ligand 1.8s ease-out both;
}
.binding-phase-1 .competing-ligand {
  animation: replace-ligand 1.8s ease-out both;
}
.binding-phase-2 .original-ligand {
  transform: translate(-95px, -58px);
  opacity: 0.25;
}
.binding-phase-2 .competing-ligand {
  transform: translateY(80px);
}
.binding-phase-2 .binding-signal {
  opacity: 0.12;
  animation: none;
}
.binding-phase-2 .partial-signal {
  opacity: 0.55;
  animation: signal-flow 2s linear infinite;
}
@keyframes displace-ligand {
  to {
    transform: translate(-95px, -58px);
    opacity: 0.25;
  }
}
@keyframes replace-ligand {
  to {
    transform: translateY(80px);
  }
}
@media (prefers-reduced-motion: reduce) {
  .binding-phase-1 .original-ligand {
    transform: translate(-95px, -58px);
    opacity: 0.25;
  }
  .binding-phase-1 .competing-ligand {
    transform: translateY(80px);
  }
}
/* رسم خاص بكل محور (chapter.figure). الألوان من نفس هوية الكومك. */
.figure-scene {
  display: block;
  width: 100%;
  max-width: 560px;
  height: auto;
  margin: auto;
  padding: 10px 8px 4px;
  overflow: visible;
}
.fig-paper { --fig: var(--paper, #fffdf5); }
.fig-red { --fig: var(--red); }
.fig-blue { --fig: var(--blue); }
.fig-yellow { --fig: var(--yellow); }
.fig-mint { --fig: var(--theory-mint); }
.fig-lilac { --fig: var(--theory-lilac); }
.fig-ink { --fig: var(--ink); }
.fig-grey { --fig: #c9ccd1; }
.figure-scene marker path {
  fill: var(--ink);
}
.fig-item rect,
.fig-item circle {
  fill: var(--fig);
  stroke: var(--ink);
  stroke-width: 2.5;
}
.figure-scene text {
  font-family: "AWAPHs Arabic", Arial, "IBM Plex Sans Arabic", sans-serif;
  font-weight: 700;
  fill: var(--ink);
  text-anchor: middle;
  dominant-baseline: central;
  direction: ltr;
}
.fig-label {
  paint-order: stroke;
  stroke: #d9e5f2;
  stroke-width: 4px;
  stroke-linejoin: round;
}
.fig-red .fig-text,
.fig-blue .fig-text,
.fig-ink .fig-text {
  fill: #fff;
}
.fig-arrow path {
  fill: none;
  stroke: var(--ink);
  stroke-width: 2.5;
}
.fig-flow path {
  stroke-dasharray: 7 5;
  animation: signal-flow 1s linear infinite;
}
.fig-weak path {
  stroke-dasharray: 3 5;
  stroke-width: 1.6;
}
.fig-cross path {
  fill: none;
  stroke: var(--red);
  stroke-width: 5;
  stroke-linecap: round;
}
.fig-dim {
  opacity: 0.3;
}
.fig-new {
  animation: fig-in 0.5s ease-out both;
}
.fig-hl rect,
.fig-hl circle {
  stroke-width: 4;
  animation: fig-pulse 1.6s ease-in-out infinite;
}
@keyframes fig-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
}
@keyframes fig-pulse {
  50% {
    stroke-width: 6;
  }
}
@media (prefers-reduced-motion: reduce) {
  .fig-new,
  .fig-hl rect,
  .fig-hl circle,
  .fig-flow path {
    animation: none;
  }
}
