/* ============================
   Spec layout: TOC + content inside centered region
   ============================ */

#umi-spec-columns {
  display: flex;
  align-items: flex-start;
  position: relative;
}

/* Fixed TOC inside the centered region */
#umi-spec-toc {
  position: sticky;
  top: 1rem;
  width: 220px;
  flex-shrink: 0;
  padding: 1rem 0.5rem;
  box-sizing: border-box;
  max-height: calc(100vh - 2rem);
  overflow-y: auto;
  background: #f7f7f9;
  border-right: 1px solid #ddd;
}

/* TOC styling */
#umi-spec-toc h2 {
  margin-top: 0;
  font-size: 1rem;
  font-weight: 600;
}

#umi-spec-toc ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

#umi-spec-toc li {
  margin: 0.4rem 0;
}

#umi-spec-toc a {
  text-decoration: none;
  color: #333;
  font-size: 0.9rem;
}

#umi-spec-toc a.active {
  font-weight: 600;
  color: #0066cc;
}

/* Scrollable content column */
#umi-spec-content {
  flex: 1;
  padding-left: 2rem;
  box-sizing: border-box;
  min-width: 0; /* prevents overflow */
}

/* Ensure content still respects umi-region geometry */
#umi-spec-content .umi-section {
  max-width: 900px;
  margin: 2.5rem 0;
}

/* ============================
   Spec section numbering
   ============================ */

/* Nested <ol> wraps each section so numbering (1, 1.1, 1.1.1 …) is
   generated automatically from the browser's built-in list-item counter. */
.spec-sections,
.spec-sections ol {
  list-style: none;
  margin: 0;
  padding: 0;
}

.spec-sections > li {
  padding: 1.5rem 0;
  border-bottom: 1px solid #ddd;
}

.spec-sections > li:last-child {
  border-bottom: none;
}

.spec-sections ol {
  padding-left: 1.5rem;
}

.spec-sections li > h2::before,
.spec-sections li > h3::before,
.spec-sections li > h4::before {
  content: counters(list-item, ".") "  ";
}

.umi-symbol {
  width: 0.4em;
  height: 0.6em;
  vertical-align: 0.4em;
}
.umi-symbol.large {
  width: 1em;
  height: 1.4em;
  vertical-align: 0.4em;
}

@media (max-width: 700px) {
  #umi-spec-columns {
    flex-direction: column;
  }

  #umi-spec-toc {
    position: static;
    width: auto;
    max-height: none;
    border-right: none;
    border-bottom: 1px solid #ddd;
    margin-bottom: 1rem;
  }

  #umi-spec-content {
    padding-left: 0;
  }
}

pre, code {
  white-space: pre-wrap;
  word-break: break-word;
}

mjx-math { white-space: normal !important; }