div.body {
    max-width: 100% !important;
}

h1 {
  padding: 0.2em;
  border-top: solid 2px;
  border-bottom: solid 2px;
}

.wy-table-responsive table td, .wy-table-responsive table th {
    white-space: normal;
}

table caption {
    text-align: left !important;
    caption-side: top; /* 省略可：上に表示 */
    padding-left: 0;
}

table.docutils th.head{
    background-color: rgba(50, 102, 153, 0.5);
}

table.docutils tr.row-odd{
    background-color: rgba(50, 102, 153, 0.2);
}

/* テーブル同士の間に下マージンを入れる */
table.docutils {
    margin-bottom: 2em;  /* 必要に応じて調整 */
    width: 100%;
    max-width: 100%;
}

table.docutils td, table.docutils th {
    white-space: normal;
}

/* パラメータテーブルのキャプション番号を非表示 */
table.no-caption-number caption span.caption-number {
    display: none;
}

/* PHITS availability badges used in the introduction legend. */
.phits-same,
.phits-other,
.phits-not-settable {
  position: relative;
  display: inline-flex;
  box-sizing: border-box;
  width: 1.15em;
  height: 1.15em;
  overflow: hidden;
  align-items: center;
  justify-content: center;
  border: 1.2px solid currentColor;
  border-radius: 50%;
  line-height: 1;
  text-indent: -9999px;
  vertical-align: -0.12em;
  background-color: transparent;
}

.phits-same::before,
.phits-other::before,
.phits-not-settable::before {
  content: "P";
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: "Times New Roman", "Times", serif;
  font-size: 0.8em;
  font-weight: normal;
  line-height: 1;
  text-indent: 0;
}

.phits-other::after,
.phits-not-settable::after {
  content: "";
  position: absolute;
  inset: 0.08em;
  border-radius: 50%;
  pointer-events: none;
}

.phits-same {
  color: #176b3a;
}

.phits-other {
  color: #d97800;
}

.phits-other::after {
  background: linear-gradient(
    -45deg,
    transparent 46%,
    currentColor 47%,
    currentColor 53%,
    transparent 54%
  );
}

.phits-not-settable {
  color: #c7352a;
}

.phits-not-settable::after {
  background:
    linear-gradient(
      45deg,
      transparent 46%,
      currentColor 47%,
      currentColor 53%,
      transparent 54%
    ),
    linear-gradient(
      -45deg,
      transparent 46%,
      currentColor 47%,
      currentColor 53%,
      transparent 54%
    );
}

/* genindexリンクを非表示 */
a[href*="genindex"] {
    display: none !important;
}

/* Adjust vertical spacing between list items for better readability.
   Adds spacing between items while removing extra space after the last item. */
div.body ul li {
  margin-bottom: 0.4em;
}

div.body ul li:last-child {
  margin-bottom: 0;
}

/* Keep related figures side by side, matching the original manual layout. */
div.figure-grid {
  display: grid;
  gap: 1rem;
  align-items: start;
  margin-bottom: 1.5rem;
}

div.figure-grid-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

div.figure-grid-4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

div.figure-grid > figure {
  min-width: 0;
  margin: 0;
  text-align: center;
}

div.figure-grid > figure img {
  width: 100% !important;
  max-width: 100%;
  height: auto;
}

img.responsive-figure {
  width: 100% !important;
  max-width: 100%;
  height: auto;
}

@media (max-width: 900px) {
  div.figure-grid-4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 600px) {
  div.figure-grid-2,
  div.figure-grid-4 {
    grid-template-columns: minmax(0, 1fr);
  }
}
