.lrs-topic .gt-nav,
.lrs-topic-layout .gt-nav {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.lrs-lab {
  grid-template-columns: minmax(280px, 360px) minmax(0, 1fr);
}

.lrs-select-label {
  display: grid;
  gap: 8px;
  color: #334155;
  font-weight: 900;
}

.lrs-select-label select {
  min-height: 40px;
  border: 1px solid rgba(148, 163, 184, 0.42);
  border-radius: 12px;
  padding: 0 10px;
  color: #0f172a;
  font-weight: 900;
  background: #fff;
}

.lrs-lab-visual,
.lrs-exp-visual {
  min-height: 320px;
  padding: 18px;
  border: 1px solid rgba(190, 202, 222, 0.82);
  border-radius: 16px;
  background:
    linear-gradient(rgba(255, 255, 255, 0.88), rgba(255, 255, 255, 0.88)),
    repeating-linear-gradient(0deg, rgba(37, 99, 235, 0.055) 0 1px, transparent 1px 30px),
    repeating-linear-gradient(90deg, rgba(20, 184, 166, 0.05) 0 1px, transparent 1px 30px);
  overflow: hidden;
}

.lrs-case-grid {
  grid-template-columns: repeat(3, minmax(270px, 1fr));
}

.lrs-case {
  display: grid;
  gap: 12px;
  min-height: 500px;
  padding: 14px;
  border: 1px solid rgba(190, 202, 222, 0.76);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 10px 24px rgba(30, 41, 59, 0.05);
}

.lrs-case-head {
  display: grid;
  gap: 4px;
}

.lrs-case-head span {
  color: #2563eb;
  font-size: 0.78rem;
  font-weight: 950;
}

.lrs-case-head strong {
  color: #0f172a;
  font-size: 1.16rem;
  line-height: 1.2;
}

.lrs-case p {
  margin: 0;
  color: #64748b;
  line-height: 1.55;
}

.lrs-case-controls {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.lrs-case-controls label {
  display: grid;
  gap: 6px;
  min-width: 0;
  color: #334155;
  font-weight: 900;
}

.lrs-case-controls input {
  width: 100%;
}

.lrs-case-scene {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 180px;
  padding: 16px;
  border-radius: 16px;
  background: linear-gradient(145deg, #f8fafc, #eef6ff);
  overflow: hidden;
}

.lrs-case-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.lrs-case-metrics span {
  display: grid;
  gap: 3px;
  padding: 10px;
  border-radius: 12px;
  color: #64748b;
  background: #f8fafc;
  font-size: 0.74rem;
  font-weight: 900;
}

.lrs-case-metrics b {
  color: #0f172a;
  font-size: 0.92rem;
  overflow-wrap: anywhere;
}

.lrs-case-result {
  min-height: 58px;
  padding: 12px;
  border-radius: 14px;
  color: #254155;
  background: rgba(236, 253, 245, 0.85);
  font-weight: 850;
  line-height: 1.45;
}

.lrs-line-stage {
  position: relative;
  width: 100%;
  min-height: 110px;
}

.lrs-line-stage span {
  position: absolute;
  left: var(--left);
  right: calc(100% - var(--right));
  top: 50%;
  height: 7px;
  border-radius: 999px;
  background: #2563eb;
}

.lrs-line-stage span.is-segment::before,
.lrs-line-stage span.is-segment::after,
.lrs-line-stage span.is-ray::before {
  content: "";
  position: absolute;
  top: 50%;
  width: 18px;
  height: 18px;
  border: 4px solid #fff;
  border-radius: 999px;
  background: #ef4444;
  box-shadow: 0 0 0 2px #2563eb;
  transform: translateY(-50%);
}

.lrs-line-stage span.is-segment::before,
.lrs-line-stage span.is-ray::before {
  left: -8px;
}

.lrs-line-stage span.is-segment::after {
  right: -8px;
}

.lrs-line-stage span.is-ray {
  left: var(--left);
  right: auto;
  width: 70%;
  transform: rotate(var(--angle));
  transform-origin: left center;
}

.lrs-line-stage span.is-ray::after,
.lrs-line-stage span.is-line::before,
.lrs-line-stage span.is-line::after {
  content: "";
  position: absolute;
  top: 50%;
  border-top: 9px solid transparent;
  border-bottom: 9px solid transparent;
  transform: translateY(-50%);
}

.lrs-line-stage span.is-ray::after,
.lrs-line-stage span.is-line::after {
  right: -2px;
  border-left: 16px solid #2563eb;
}

.lrs-line-stage span.is-line {
  left: 4%;
  right: 4%;
}

.lrs-line-stage span.is-line::before {
  left: -2px;
  border-right: 16px solid #2563eb;
}

.lrs-line-stage .point-a,
.lrs-line-stage .point-b {
  position: absolute;
  top: calc(50% - 26px);
  width: 22px;
  height: 22px;
  border-radius: 999px;
  background: #f97316;
  box-shadow: 0 0 0 4px rgba(249, 115, 22, 0.16);
}

.lrs-line-stage .point-a {
  left: var(--left);
}

.lrs-line-stage .point-b {
  left: var(--right);
}

.lrs-line-stage span.is-line ~ .point-a,
.lrs-line-stage span.is-line ~ .point-b {
  background: #14b8a6;
}

.lrs-line-stage span.is-ray ~ .point-b,
.lrs-line-stage span.is-line ~ .point-a,
.lrs-line-stage span.is-line ~ .point-b {
  width: 14px;
  height: 14px;
  opacity: 0.7;
}

.lrs-ruler-prop,
.lrs-road-prop,
.lrs-flashlight-prop,
.lrs-laser-prop,
.lrs-fence-prop,
.lrs-map-prop,
.lrs-horizon-prop,
.lrs-railway-prop,
.lrs-sun-prop,
.lrs-arrow-prop,
.lrs-screen-prop,
.lrs-construction-prop {
  position: absolute;
  inset: auto 14px 16px;
  height: 42px;
  border-radius: 12px;
  opacity: 0.95;
}

.lrs-ruler-prop {
  background: repeating-linear-gradient(90deg, #fbbf24 0 18px, #f59e0b 18px 20px);
}

.lrs-road-prop {
  background: linear-gradient(180deg, #475569, #334155);
}

.lrs-road-prop::after,
.lrs-railway-prop::after {
  content: "";
  position: absolute;
  left: 8%;
  right: 8%;
  top: 50%;
  height: 4px;
  background: repeating-linear-gradient(90deg, #f8fafc 0 20px, transparent 20px 34px);
}

.lrs-flashlight-prop {
  left: 20px;
  right: auto;
  width: 82px;
  background: #334155;
  clip-path: polygon(0 30%, 70% 30%, 100% 0, 100% 100%, 70% 70%, 0 70%);
}

.lrs-laser-prop {
  left: 24px;
  right: auto;
  width: 96px;
  height: 18px;
  background: #ef4444;
}

.lrs-fence-prop {
  background:
    repeating-linear-gradient(90deg, transparent 0 28px, #92400e 28px 36px),
    linear-gradient(180deg, transparent 0 12px, #b45309 12px 22px, transparent 22px);
}

.lrs-map-prop {
  background:
    linear-gradient(135deg, transparent 45%, rgba(34, 197, 94, 0.2) 46% 55%, transparent 56%),
    #ecfeff;
}

.lrs-horizon-prop {
  height: 80px;
  background: linear-gradient(180deg, #bfdbfe 0 48%, #0ea5e9 49%, #38bdf8);
}

.lrs-railway-prop {
  background:
    repeating-linear-gradient(90deg, transparent 0 26px, #78350f 26px 34px),
    linear-gradient(180deg, transparent 0 12px, #64748b 12px 18px, transparent 18px 25px, #64748b 25px 31px, transparent 31px);
}

.lrs-sun-prop {
  right: auto;
  left: 24px;
  top: 18px;
  bottom: auto;
  width: 54px;
  height: 54px;
  border-radius: 999px;
  background: #f59e0b;
  box-shadow: 0 0 0 12px rgba(245, 158, 11, 0.18);
}

.lrs-arrow-prop {
  left: 24px;
  right: auto;
  width: 78px;
  background: #14b8a6;
  clip-path: polygon(0 35%, 60% 35%, 60% 10%, 100% 50%, 60% 90%, 60% 65%, 0 65%);
}

.lrs-screen-prop {
  left: 50%;
  width: 155px;
  transform: translateX(-50%);
  border: 8px solid #111827;
  border-radius: 14px;
  background: #bfdbfe;
}

.lrs-construction-prop {
  background:
    repeating-linear-gradient(90deg, #facc15 0 22px, #111827 22px 44px);
}

.lrs-exp-workbench {
  display: grid;
  grid-template-columns: minmax(280px, 360px) minmax(0, 1fr);
  gap: 18px;
  padding-top: 16px;
  border-top: 1px solid rgba(148, 163, 184, 0.24);
}

.lrs-experiment,
.lrs-exp-board {
  display: grid;
  gap: 18px;
}

.lrs-exp-story {
  display: grid;
  gap: 12px;
  align-content: start;
  padding: 18px;
  border: 1px solid rgba(37, 99, 235, 0.22);
  border-radius: 16px;
  background: linear-gradient(145deg, #ffffff, #eff6ff);
  box-shadow: 0 16px 34px rgba(37, 99, 235, 0.08);
}

.lrs-exp-story > span {
  width: fit-content;
  padding: 5px 10px;
  border-radius: 999px;
  color: #1d4ed8;
  background: rgba(37, 99, 235, 0.12);
  font-size: 0.78rem;
  font-weight: 950;
}

.lrs-exp-story > strong {
  color: #102033;
  font-size: 1.08rem;
  line-height: 1.35;
}

.lrs-exp-story p {
  margin: 0;
  color: #536171;
  line-height: 1.65;
}

.lrs-exp-visual .lrs-line-stage,
.lrs-lab-visual .lrs-line-stage {
  min-height: 260px;
}

html[lang="en"] .lrs-case-head strong,
html[lang="en"] .lrs-case-result,
html[lang="en"] .lrs-case-metrics b,
html[lang="en"] .lrs-exp-story > strong,
html[lang="en"] .lrs-exp-story p {
  overflow-wrap: anywhere;
  line-height: 1.25;
}

html[lang="en"] .lrs-case-grid {
  grid-template-columns: repeat(auto-fit, minmax(310px, 1fr));
}

html[lang="en"] .lrs-case {
  min-height: 535px;
}

@media (max-width: 980px) {
  .lrs-lab,
  .lrs-exp-workbench {
    grid-template-columns: 1fr;
  }

  .lrs-case-grid {
    grid-template-columns: 1fr;
  }

  .lrs-case-controls,
  .lrs-case-metrics {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .lrs-topic .gt-nav,
  .lrs-topic-layout .gt-nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
