.wy-nav-content {
  max-width: 100%;
}

/* ReadTheDocs theme often forces nowrap inside responsive tables, which makes
   glossary tables scroll horizontally. Allow wrapping in table cells. */
.wy-table-responsive table td,
.wy-table-responsive table th,
.rst-content table td,
.rst-content table th {
  white-space: normal !important;
  overflow-wrap: anywhere;
  word-break: normal;
  vertical-align: top;
}

.wy-table-responsive table td code,
.wy-table-responsive table th code,
.rst-content table td code,
.rst-content table th code {
  white-space: normal !important;
  overflow-wrap: anywhere;
  word-break: break-word;
}

/* Keep wrapper but prevent giant single-line rows from stretching layout. */
.wy-table-responsive table {
  table-layout: auto;
  width: 100%;
}

.arc-demo {
  margin: 0.8rem 0 0;
  padding: 12px;
  border: 1px solid #d7dee7;
  border-radius: 10px;
  background: #ffffff;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.arc-demo__controls {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
  margin-bottom: 10px;
}

.arc-demo__fieldset {
  margin: 0;
  padding: 8px 10px;
  border: 1px solid #d7dee7;
  border-radius: 8px;
  min-width: 0;
}

.arc-demo__fieldset legend {
  padding: 0 6px;
  font-size: 0.85rem;
  font-weight: 600;
}

.arc-demo__fieldset label {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 4px 0;
  line-height: 1.3;
  font-size: 0.95rem;
}

.arc-demo__fieldset input[type="radio"] {
  margin: 0;
}

.arc-demo__viewport {
  max-width: 520px;
  border: 1px solid #d7dee7;
  border-radius: 8px;
  overflow: hidden;
  background: #fbfdff;
}

.arc-demo__svg {
  display: block;
  width: 100%;
  height: auto;
}

.arc-demo__meta {
  margin-top: 8px;
}

.arc-demo__legend {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 6px;
}

.arc-demo__chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid #d7dee7;
  background: #f6f9fc;
  line-height: 1.2;
  font-size: 0.9rem;
}

.arc-demo__current {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  line-height: 1.3;
  font-size: 0.95rem;
}

.arc-demo__swatch {
  display: inline-block;
  width: 14px;
  height: 0;
  border-top: 3px solid currentColor;
  vertical-align: middle;
}

.arc-demo__swatch--fwd {
  color: #198754;
}

.arc-demo__swatch--back {
  color: #b26a00;
  border-top-style: dashed;
}

@media (max-width: 640px) {
  .arc-demo {
    padding: 10px;
  }

  .arc-demo__fieldset label {
    font-size: 0.9rem;
  }

  .arc-demo__chip,
  .arc-demo__current {
    font-size: 0.85rem;
  }
}
