.univ-hero {
  display: grid;
  gap: 0.8rem;
}

.univ-hero .lead {
  margin-top: 0;
}

.univ-anchor {
  scroll-margin-top: 6.2rem;
}

.univ-section {
  display: grid;
  gap: 0.9rem;
}

.univ-section .section-title {
  margin-bottom: 0;
}

.univ-section p {
  margin: 0;
}

.univ-formula {
  margin: 0.15rem 0 0;
  padding: 0.85rem 1rem;
  border: 1px solid #d7c7a6;
  border-left: 4px solid #87651b;
  background: #fffdf9;
  overflow-x: auto;
}

.univ-gallery {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  margin-top: 0.35rem;
}

.univ-note-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  margin-top: 0.35rem;
}

.univ-datasets {
  display: grid;
  gap: 0.7rem;
  border: 1px solid var(--line);
  background: #fffdf9;
  padding: 1rem;
}

.univ-placeholder,
.univ-module,
.univ-figure,
.univ-note {
  border: 1px solid var(--line);
  background: #fffdf9;
  padding: 1rem;
}

.univ-placeholder {
  border-style: dashed;
  display: grid;
  gap: 0.55rem;
}

.univ-reference {
  max-width: 38rem;
}

.univ-placeholder h3,
.univ-module h3,
.univ-figure h3 {
  margin: 0;
}

.univ-placeholder p,
.univ-module p,
.univ-figure p {
  margin: 0;
}

.univ-placeholder .detail-list,
.univ-module .steps {
  margin-top: 0.15rem;
}

.univ-figure {
  display: grid;
  gap: 0.65rem;
}

.univ-note {
  display: grid;
  gap: 0.45rem;
  padding: 0.85rem;
}

.univ-note h3,
.univ-note p {
  margin: 0;
}

.univ-figure-wide {
  grid-column: 1 / -1;
}

.univ-figure-button {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: zoom-in;
}

.univ-figure img {
  width: 100%;
  height: auto;
  border: 1px solid var(--line);
  background: #fff;
}

.univ-figure video {
  width: 100%;
  height: auto;
  border: 1px solid var(--line);
  background: #fff;
}

.univ-figure-button:hover img,
.univ-figure-button:focus-visible img {
  border-color: #a98a4a;
}

.univ-figure figcaption {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.univ-lightbox {
  width: min(1100px, 94vw);
  max-height: 92vh;
  padding: 0;
  border: 1px solid #bca882;
  background: #fbf7ef;
  color: var(--text);
}

.univ-lightbox::backdrop {
  background: rgba(19, 17, 13, 0.78);
}

.univ-lightbox-shell {
  display: grid;
  gap: 0.85rem;
  padding: 1rem;
}

.univ-lightbox-top {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 1rem;
}

.univ-lightbox-title {
  margin: 0;
  font-size: 1.05rem;
}

.univ-lightbox-close {
  min-height: 44px;
  min-width: 44px;
  border: 1px solid var(--line);
  background: #fffdf9;
  color: var(--text);
  cursor: pointer;
}

.univ-lightbox-close:hover,
.univ-lightbox-close:focus-visible {
  background: #f0e6d3;
}

.univ-lightbox img {
  width: 100%;
  max-height: calc(92vh - 10rem);
  object-fit: contain;
  border: 1px solid var(--line);
  background: #fff;
}

.univ-lightbox-caption {
  margin: 0;
  color: var(--muted);
  font-size: 0.94rem;
}

.univ-module {
  margin-top: 1rem;
  display: grid;
  gap: 0.7rem;
}

.univ-module-header {
  display: grid;
  gap: 0.25rem;
}

.univ-next {
  max-width: 48rem;
  margin-top: 1.5rem;
}

.sim-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  background: #fffdf9;
  padding: 0.4rem;
}

.sim-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

.sim-table caption {
  caption-side: top;
  text-align: left;
  margin-bottom: 0.6rem;
  color: var(--muted);
  font-size: 0.92rem;
}

.sim-table th,
.sim-table td {
  padding: 0.6rem 0.75rem;
  border-top: 1px solid var(--line);
  vertical-align: top;
}

.sim-table thead th {
  border-top: 0;
  background: #f8f3e8;
  font-weight: 600;
}

.sim-table th:first-child,
.sim-table td:first-child {
  text-align: left;
}

.sim-table th:not(:first-child),
.sim-table td:not(:first-child) {
  text-align: center;
  font-variant-numeric: tabular-nums;
}

@media (max-width: 820px) {
  .univ-note-grid,
  .univ-gallery {
    grid-template-columns: 1fr;
  }

  .univ-figure-wide {
    grid-column: auto;
  }

  .univ-lightbox {
    width: min(96vw, 96vw);
  }
}
