/* The vIOMMU lab: the address map, the step list and the RAM markers. */
.viommu-map {
  margin: 1.5rem 0;
  max-width: 760px;
  overflow-x: auto;
}
.viommu-map svg {
  width: 100%;
  min-width: 600px;  /* on a phone, scroll rather than shrink the labels */
  height: auto;
}
.viommu-box rect {
  fill: var(--surface);
  stroke: var(--line);
}
.viommu-guest rect,
.viommu-host rect {
  stroke: var(--accent);
  stroke-width: 2;
}
.viommu-map text {
  fill: var(--ink);
  font: 600 15px/1 system-ui, sans-serif;
  text-anchor: middle;
}
.viommu-map .viommu-addr {
  font: 13px/1 ui-monospace, Consolas, monospace;
}
.viommu-map .viommu-small {
  fill: var(--muted);
  font-size: 12px;
  font-weight: 400;
}
.viommu-map .viommu-used rect {
  stroke: var(--accent);
  stroke-width: 3;
}
.viommu-map .viommu-stop rect {
  stroke: var(--deny);
  stroke-width: 3;
}
.viommu-map .viommu-skip rect {
  stroke-dasharray: 5 5;
}
.viommu-fields {
  margin: 0.5rem 0;
  padding-left: 1.1rem;
  font-size: 0.95rem;
}
.viommu-inset {
  margin: 1rem 0;
}
.viommu-arrows path {
  fill: none;
  stroke: var(--accent);
  stroke-width: 2.5;
}
.viommu-arrows .viommu-dashed {
  stroke: var(--muted);
  stroke-dasharray: 5 5;
}
.viommu-question {
  font-size: 1.1rem;
  font-weight: 600;
}
.viommu-path {
  border: 0;
  margin: 1rem 0;
  padding: 0;
  display: grid;
  gap: 0.4rem;
}
.viommu-path label {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  min-height: 44px;
  font-size: 0.95rem;
}
.viommu-path input {
  width: auto;
  min-height: 0;
  margin: 0;
  flex: none;
}
.viommu-result {
  min-height: 1.5em;
  font-weight: 600;
}
.viommu-steps {
  display: grid;
  gap: 0.5rem;
  padding-left: 1.2rem;
}
.viommu-steps li {
  overflow-wrap: anywhere;
}
.viommu-steps b {
  display: block;
}
.viommu-steps span {
  font: 0.86rem/1.5 ui-monospace, Consolas, monospace;
}
.viommu-steps .viommu-pending {
  color: var(--muted);
}
.viommu-steps .viommu-blocked b {
  color: var(--deny);
}
.viommu-steps .viommu-warn b {
  color: var(--warn);
}
.viommu-takeaway {
  border-left: 3px solid var(--accent);
  padding-left: 0.8rem;
}
.viommu-list {
  margin: 0;
  padding-left: 1.1rem;
  font: 0.84rem/1.5 var(--term-font);
  font-variant-ligatures: none;
  overflow-wrap: anywhere;
}
.viommu-list .viommu-new {
  font-weight: 700;
}
.viommu-list .viommu-new::before {
  content: "new: ";
}
.viommu-words dl {
  display: grid;
  grid-template-columns: minmax(8rem, max-content) 1fr;
  gap: 0.3rem 1rem;
  margin: 0.6rem 0 1rem;
}
.viommu-words dt {
  font-weight: 600;
}
.viommu-words dd {
  margin: 0;
}
@media (max-width: 560px) {
  .viommu-words dl {
    grid-template-columns: 1fr;
  }
  .viommu-words dd {
    margin-bottom: 0.4rem;
  }
}
.viommu-page pre mark {
  background: var(--accent);
  color: var(--button-ink);
}
.viommu-guide {
  max-width: 72ch;
}
/* R41: headings sized for a 72ch reading column (the site's display sizes
   made a 33-item list 14,700 px tall). */
.viommu-guide h2 {
  margin-top: 2.5rem;
  font-size: clamp(1.75rem, 3vw, 2.25rem);
}
.viommu-guide h3 {
  margin-top: 2rem;
  font-size: 1.3rem;
  line-height: 1.35;
  letter-spacing: -0.015em;
}

/* Commands stay whole: scroll rather than wrap mid-option. */
.viommu-guide pre {
  white-space: pre;
  overflow-x: auto;
}

.viommu-facts {
  display: grid;
  grid-template-columns: minmax(10rem, max-content) 1fr;
  gap: 0.2rem 1rem;
  margin: 0.5rem 0;
}
.viommu-facts dt {
  font-weight: 600;
}
.viommu-facts dd {
  margin: 0;
}
.viommu-inset li[aria-current="step"] {
  font-weight: 700;
}
.viommu-inset li[aria-current="step"]::before {
  content: "▶ this step: ";
}
#viommu-rows th,
#viommu-rows td {
  vertical-align: top;
  text-align: left;
}
#viommu-rows ul {
  margin: 0;
  padding-left: 1rem;
  font: 0.84rem/1.5 ui-monospace, Consolas, monospace;
}
/* On a phone the picture would need panning: the same route reads as a list. */
.viommu-stack {
  display: none;
}
@media (max-width: 560px) {
  #viommu-map {
    display: none;
  }
  .viommu-stack {
    display: grid;
    gap: 0.4rem;
    padding-left: 1.2rem;
  }
}
/* Ownership: regions differ by border style and carry a letter, not just a colour. */
.viommu-regions rect {
  fill: none;
  stroke: var(--line);
  stroke-width: 1.5;
}
.viommu-regions .viommu-region-g {
  stroke-dasharray: 10 4;
}
.viommu-regions .viommu-region-h {
  stroke-dasharray: 2 4;
}
.viommu-own path {
  fill: none;
  stroke: var(--muted);
  stroke-width: 2;
  stroke-dasharray: 1 4;
  stroke-linecap: round;
}
/* Request arrows: solid with a head when this request used them. */
.viommu-arrows path {
  marker-end: url(#viommu-head);
}
#viommu-head path {
  fill: var(--accent);
  stroke: none;
}
.viommu-arrows path:not(.viommu-on):not(.viommu-dashed) {
  stroke: var(--muted);
  stroke-width: 1.5;
  stroke-dasharray: 3 3;
}
.viommu-kinds,
.viommu-states {
  margin: 0.5rem 0;
  padding-left: 1.1rem;
}
.viommu-kinds li[aria-current],
.viommu-states li[aria-current] {
  font-weight: 700;
}
#viommu-cache td,
#viommu-cache th {
  vertical-align: top;
  text-align: left;
  font-size: 0.84rem;
}
#viommu-cache .viommu-c-added td:last-child,
#viommu-cache .viommu-c-dropped td:last-child,
#viommu-cache .viommu-c-changed td:last-child {
  font-weight: 700;
}
.viommu-lanes {
  display: grid;
  gap: 0.5rem;
  grid-template-columns: repeat(auto-fit, minmax(min(14rem, 100%), 1fr));
}
.viommu-lanes section,
.viommu-axis {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.4rem 0.6rem;
}
.viommu-lanes table {
  grid-column: 1 / -1;
}
.viommu-axes {
  display: grid;
  gap: 0.5rem;
  grid-template-columns: repeat(auto-fit, minmax(min(14rem, 100%), 1fr));
}
.viommu-axis label {
  display: flex;
  gap: 0.5rem;
  min-height: 44px;
  align-items: center;
}
.viommu-axis input {
  width: auto;
  min-height: 0;
  flex: none;
}
.viommu-conceptual {
  border: 1px dashed var(--muted);
  padding: 0.3rem 0.5rem;
}
.viommu-ofgraph svg {
  display: block;
  width: 100%;
  max-width: 28rem;
  font-size: 12px;
}
.viommu-onode {
  cursor: pointer;
}
.viommu-onode rect {
  fill: var(--surface);
  stroke: var(--muted);
  stroke-dasharray: 4 3;
}
.viommu-onode text {
  fill: var(--ink);
  text-anchor: middle;
}
.viommu-onode[aria-pressed=true] rect {
  stroke: var(--accent);
  stroke-width: 3;
}
.viommu-onode:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}
.viommu-oedge {
  stroke: var(--muted);
  stroke-width: 1.5;
  stroke-dasharray: 3 3;
}
.viommu-oedge.viommu-on {
  stroke: var(--accent);
  stroke-width: 3;
  stroke-dasharray: none;
}
.viommu-map .viommu-lanelabels text {
  text-anchor: start;
}
