.stem-grid .lesson-card {
  position: relative;
  overflow: hidden;
}

.stem-symbol {
  float: right;
  margin: -12px 0 8px 16px !important;
  color: rgba(142, 72, 32, 0.18);
  font-family: serif;
  font-size: 3.2rem;
  font-weight: 800;
  line-height: 1;
}

.stem-note {
  margin-top: 20px;
}

.stem-han {
  color: #e9b96f;
  font-family: serif;
  white-space: nowrap;
}

.stem-facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 0;
}

.stem-facts div {
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel-soft);
}

.stem-facts dt {
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 700;
}

.stem-facts dd {
  margin: 3px 0 0;
  font-weight: 800;
}

.digit-strip {
  display: grid;
  grid-template-columns: repeat(10, minmax(56px, 1fr));
  gap: 8px;
  margin: 0 0 18px;
}

.digit-strip a {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 10px 6px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel-soft);
  text-decoration: none;
}

.digit-strip strong {
  color: var(--accent);
  font-size: 1.35rem;
  line-height: 1;
}

.digit-strip span {
  font-weight: 800;
}

.stem-relations {
  margin: 0;
  padding-left: 22px;
}

.stem-relations li + li {
  margin-top: 8px;
}

.year-examples {
  padding: 12px 14px;
  border-left: 3px solid var(--accent);
  background: var(--panel-soft);
}

.boundary-note {
  color: var(--muted);
}

.stem-nav div {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.stem-nav a,
.stem-nav strong {
  display: inline-flex;
  min-width: 44px;
  justify-content: center;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel-soft);
}

.stem-nav strong {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

.wuxing-moc { color: #16733a; }
.wuxing-hoa { color: #c22323; }
.wuxing-tho { color: #9b680f; }
.wuxing-kim { color: #555; }
.wuxing-thuy { color: #1568a6; }

.stem-nav strong.wuxing-moc { color: #bce8ad; }
.stem-nav strong.wuxing-hoa { color: #ffc5bb; }
.stem-nav strong.wuxing-tho { color: #ffe39a; }
.stem-nav strong.wuxing-kim { color: #f1f4f6; }
.stem-nav strong.wuxing-thuy { color: #c4e1ff; }

@media (max-width: 860px) {
  .digit-strip {
    grid-template-columns: repeat(5, minmax(56px, 1fr));
  }
}

@media (max-width: 620px) {
  .stem-facts {
    grid-template-columns: 1fr;
  }

  .digit-strip {
    grid-template-columns: repeat(2, minmax(80px, 1fr));
  }
}
