/* ──────────────────────────────────────────────────────────────
   Memória de cálculo pública — mesma hierarquia visual do app
   ────────────────────────────────────────────────────────────── */
.memory-live-fragment {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
  overflow-x: hidden;
  overflow-y: visible;
  color: #182230;
  font-family: Inter, "Segoe UI", Roboto, Arial, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  text-align: left;
  background: #fff;
}
.memory-live-fragment .section-title {
  font-size: 1.4rem;
  font-weight: 700;
  margin-top: 28px;
  margin-bottom: 12px;
  padding-bottom: 6px;
  border-bottom: 2px solid #0d6efd;
  color: #0d6efd;
}
.memory-live-fragment > .section-title:first-child,
.memory-live-fragment > .subsection-title:first-child { margin-top: 0; }
.memory-live-fragment .subsection-title {
  font-size: 1.15rem;
  font-weight: 600;
  margin-top: 22px;
  margin-bottom: 8px;
  padding-bottom: 4px;
  border-bottom: 1px solid #dee2e6;
  color: #333;
}
.memory-live-fragment .math-equation {
  color: #0d6efd;
  background-color: #f8f9fa;
  padding: 15px;
  border-radius: 5px;
  border: 1px solid #e9ecef;
  margin: 12px 0 18px;
  overflow-x: auto;
  overflow-y: hidden;
  font-size: 1.1em;
  line-height: 1.6;
  max-width: 100%;
  box-sizing: border-box;
  text-align: center;
}
.memory-live-fragment .math-equation + .subsection-title,
.memory-live-fragment .math-equation + .section-title,
.memory-live-fragment .verification-box + .subsection-title,
.memory-live-fragment .verification-box + .section-title { margin-top: 28px; }
.memory-live-fragment .math-equation mjx-container,
.memory-live-fragment .math-equation mjx-container[jax="SVG"],
.memory-live-fragment .math-equation mjx-container[jax="SVG"] > svg {
  color: #0d6efd !important;
}
.memory-live-fragment .math-equation mjx-container svg path,
.memory-live-fragment .math-equation mjx-container svg use,
.memory-live-fragment .math-equation mjx-container svg text {
  fill: #0d6efd !important;
}
.memory-live-fragment mjx-container[jax="SVG"] {
  display: inline-block;
  max-width: 100%;
  vertical-align: middle;
}
.memory-live-fragment mjx-container[jax="SVG"][display="true"] {
  display: block;
  width: 100%;
  max-width: 100%;
  margin: .8em 0;
  overflow-x: auto;
  overflow-y: hidden;
  text-align: center;
  -webkit-overflow-scrolling: touch;
}
.memory-live-fragment .math-equation > mjx-container[jax="SVG"] {
  display: block !important;
  width: 100%;
  max-width: 100%;
  margin: .8em auto;
  text-align: center;
}
.memory-live-fragment mjx-container[jax="SVG"] > svg {
  max-width: none;
}
/* Grid/flex items must be allowed to shrink; long equations scroll inside their own box. */
.proof-grid > *,
.demo-media-grid > *,
.memory-grid > * { min-width: 0; }
.proof-figure,
.demo-shot.memory-figure { min-width: 0; max-width: 100%; overflow: hidden; }
.memory-live-fragment .math-equation { scrollbar-width: thin; }
.memory-live-fragment .memory-note {
  background: #eee;
  border: 1px solid #cfcfcf;
  color: #222;
  padding: 8px 10px;
  margin: 8px 0;
  font-size: 1rem;
  line-height: 1.55;
}
.memory-live-fragment .verification-box {
  padding: 15px;
  border-radius: 5px;
  margin: 12px 0;
  border: 1px solid #dee2e6;
  border-left-width: 4px;
  background-color: #f8f9fa;
  color: #333;
  font-size: .95rem;
}
.memory-live-fragment .verification-box.info { border-left-color: #0d6efd; background: #e8f0fe; color: #084298; }
.memory-live-fragment .verification-box.success { border-left-color: #28a745; background: #eafaf1; color: #155724; }
.memory-live-fragment .verification-box.warning { border-left-color: #ffc107; background: #fff8e1; color: #856404; }
.memory-live-fragment .verification-box.danger { border-left-color: #dc3545; background: #fdf0f0; color: #842029; }
.memory-live-fragment .alert,
.memory-live-fragment .alert-success,
.memory-live-fragment .alert-danger,
.memory-live-fragment .alert-warning,
.memory-live-fragment .alert-info,
.memory-live-fragment .alert-light,
.memory-live-fragment .alert-secondary {
  background: transparent;
  border: 0;
  border-left: 2px solid #c8c8c8;
  border-radius: 0;
  padding: 3px 0 3px 10px;
  margin: 6px 0;
  color: inherit;
  box-shadow: none;
}
.memory-live-fragment .table-responsive {
  display: block;
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.memory-live-fragment table,
.memory-live-fragment .table {
  width: 100%;
  margin: 0 0 1rem;
  border-collapse: collapse;
  color: inherit;
  font-size: inherit;
  line-height: inherit;
  vertical-align: top;
  border-color: #dee2e6;
}
.memory-live-fragment th,
.memory-live-fragment td {
  padding: .5rem .5rem;
  border-bottom: 1px solid #dee2e6;
  vertical-align: top;
}
.memory-live-fragment .table-sm th,
.memory-live-fragment .table-sm td { padding: .25rem .25rem; }
.memory-live-fragment .align-middle th,
.memory-live-fragment .align-middle td { vertical-align: middle; }
.memory-live-fragment th { font-weight: 700; }
.memory-live-fragment .table-primary td,
.memory-live-fragment .table-primary th { background: #cfe2ff; }
.memory-live-fragment .small,
.memory-live-fragment small { font-size: .875em; }
.memory-live-fragment .text-muted { color: #6c757d; }
.memory-live-fragment .text-center { text-align: center; }
.memory-live-fragment .fw-bold { font-weight: 700; }
.memory-live-fragment .mt-2 { margin-top: .5rem !important; }
.memory-live-fragment .mt-3 { margin-top: 1rem !important; }
.memory-live-fragment .mb-1 { margin-bottom: .25rem !important; }
.memory-live-fragment .mb-2 { margin-bottom: .5rem !important; }
.memory-live-fragment .mb-3 { margin-bottom: 1rem !important; }
.memory-fragment-loading,
.memory-fragment-error {
  padding: 18px 20px;
  border: 1px solid #dee2e6;
  border-radius: 5px;
  background: #f8f9fa;
  color: #6c757d;
  font-size: .95rem;
}
.memory-fragment-error { border-left: 4px solid #b45309; color: #78350f; }
.memory-fragment-error a { color: inherit; font-weight: 700; }
.demo-shot.memory-figure { padding: 18px; }
.demo-shot.memory-figure figcaption { margin: 14px -18px -18px; border-top: 1px solid var(--border); }
.demo-media-grid.memory-grid { grid-template-columns: 1fr; }
.proof-figure.memory-figure { overflow: hidden; }

@media (max-width: 768px) {
  .memory-live-fragment .table-responsive table { min-width: 600px; }
}
