.formula-inline {
  display: inline-block;
  max-width: 100%;
  overflow-x: auto;
  vertical-align: middle;
}
.formula-display {
  display: block;
  max-width: 100%;
  overflow-x: auto;
}
.formula-display .katex-display {
  margin: .65em 0;
}
.formula-inline .katex,
.formula-display .katex {
  overflow-wrap: normal;
}
.formula-source-toggle {
  border: 1px solid #d5dfed;
  border-radius: 6px;
  padding: 0 .45em;
  background: #f6f8fb;
  color: #274ba3;
  font: inherit;
  font-size: .85em;
  cursor: pointer;
}
.formula-source {
  display: block;
  margin-top: .4em;
  font-size: .8em;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.formula-source[hidden] {
  display: none;
}
#catalog-message:empty, #catalog-detail .feedback:empty { display: none; }

#catalog-detail .fact {
  background: #edf3ff;
  border: 1px solid #cddaf2;
  border-radius: 16px;
  padding: clamp(20px, 4vw, 38px);
  margin-bottom: 18px;
  overflow-wrap: anywhere;
}
#catalog-detail .fact h1 {
  font-size: clamp(25px, 4vw, 40px);
  line-height: 1.32;
  margin: 8px 0;
}
#catalog-detail .fact small { color: #475a78; }
#catalog-detail .answer {
  color: #163e90;
  font-size: 1.22rem;
  font-weight: 700;
}
#catalog-detail .actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}
#catalog-detail .actions > * {
  font: inherit;
  font-size: .9375rem;
  line-height: 1.5;
  border: 1px solid #a7bbdf;
  border-radius: 7px;
  background: white;
  color: #244683;
  padding: 7px 12px;
  text-decoration: none;
  cursor: pointer;
}
#catalog-detail .feedback { color: #314569; }
.problem-hero h2 {
  font-size: clamp(32px, 5vw, 50px);
  line-height: 1.15;
  margin: 10px 0 15px;
}
.problem-hero .formula-display { -webkit-overflow-scrolling: touch; }
.problem-hero details {
  margin: 1rem 0 0;
  color: #e3ebff;
  background: #1d3675;
  border-color: #4762a0;
  padding: .7rem 1rem;
}
.problem-hero details p { margin-top: .65rem; }
.problem-hero .problem-statement { max-width: none; }

#problem-refs p:last-child, #problem-milestones details p:last-child { margin-bottom: 0; }

#catalog-detail [hidden] { display: none; }
#problem-research:has(> [hidden]) { grid-template-columns: minmax(0, 1fr); }
