/* The security chapters: the lab diagram's lit path, packet and stamp, and a
   few guide pieces. The lab itself uses viommu.css's classes, so every
   chapter's experiments look the same. */
[data-lab-diagram] [data-node] rect {
  transition: stroke 0.2s, fill 0.2s;
}
[data-lab-diagram] .is-on rect {
  stroke: var(--accent);
  stroke-width: 3;
}
[data-lab-diagram] .is-stop rect {
  stroke: var(--deny);
  stroke-width: 3;
  stroke-dasharray: 6 4;
}
[data-lab-diagram] .is-end rect {
  fill: color-mix(in srgb, var(--accent) 16%, var(--surface));
}
.lab-packet {
  fill: var(--accent);
}
.lab-stamp {
  fill: var(--ink);
  font: 700 20px/1 system-ui, sans-serif;
  text-anchor: middle;
}
.lab-other {
  font-size: 0.95rem;
}
.lab-walk {
  display: grid;
  gap: 0.4rem;
}
.glossary-list dt {
  font-weight: 700;
  margin-top: 1rem;
}
.glossary-full {
  font-weight: 400;
  color: var(--muted);
}
.glossary-list dd {
  margin: 0.2rem 0 0;
}
/* The AMD/Arm/Intel names table: wide enough that the concept column never
   breaks mid-word on a phone (the container scrolls instead). */
.glossary-names {
  min-width: 44rem;
}
.glossary-names-concept {
  width: 9.5rem;
}
.glossary-where {
  display: block;
  font-size: 0.9rem;
  color: var(--muted);
}
/* R41 (M11): "You shall not pass." under the RMP check when it refuses. */
[data-lab-diagram] .lab-line {
  fill: var(--muted);
  font: italic 400 13px/1 system-ui, sans-serif;
  text-anchor: middle;
}
/* The address route and RMP rows under the confidential-VM experiments. */
.rmp-figure-title {
  margin-bottom: 0.4rem;
}
.rmp-route {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  list-style: none;
  margin: 0 0 0.6rem;
  padding: 0;
}
.rmp-hop {
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 0.15rem;
  padding: 0.4rem 0.6rem;
}
.rmp-hop small {
  color: var(--muted);
}
.rmp-none {
  border-style: dashed;
}
.rmp-none code {
  color: var(--muted);
}
.fig-table .rmp-selected :is(th, td) {
  border-color: var(--accent);
  border-width: 2px;
  font-weight: 700;
}
.rmp-failed td:last-child {
  color: var(--deny);
  font-weight: 700;
}
/* RMP scenes 03 to 07: state is always in words; the markers only add to them. */
.rmp-scene,
.rmp-scene-group {
  border: 1px solid var(--line);
  border-radius: 10px;
  margin: 1rem 0;
  padding: 0.6rem 0.8rem;
}
.rmp-guest {
  border-left: 3px solid var(--line);
  margin: 0.6rem 0;
  padding-left: 0.6rem;
}
.rmp-rails {
  display: grid;
  gap: 0.8rem;
  grid-template-columns: repeat(auto-fit, minmax(min(16rem, 100%), 1fr));
}
.rmp-rail {
  list-style: none;
  margin: 0;
  padding: 0;
}
.rmp-rail li {
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  margin: 0.3rem 0;
  padding: 0.3rem 0.6rem;
}
.rmp-rail small {
  color: var(--muted);
}
.rmp-rail li.rmp-rail-current {
  border: 2px solid var(--accent);
}
.rmp-rail li.rmp-rail-conceptual {
  border-style: dashed;
}
.fig-table {
  border-collapse: collapse;
  margin: 0.4rem 0;
  min-width: 28rem;
}
.fig-table caption {
  color: var(--muted);
  text-align: left;
}
.fig-table :is(th, td) {
  border: 1px solid var(--line);
  padding: 0.25rem 0.5rem;
  text-align: left;
  vertical-align: top;
}
.fig-table .fig-failed td:nth-child(n + 2) {
  color: var(--deny);
  font-weight: 700;
}
.fig-table .fig-not-consulted td {
  color: var(--muted);
  font-style: italic;
}
.consulted-state [role="tablist"] {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 0.6rem;
}
.consulted-state [role="tab"][aria-selected="true"] {
  border-color: var(--accent);
  border-width: 2px;
  font-weight: 700;
}
/* The two-lane figure: addresses above, the RMP row below, a lookup edge between. */
.rmp-lane {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.4rem 0.8rem;
}
.rmp-lane h4 {
  margin: 0.2rem 0;
}
.rmp-lookup {
  border-left: 3px solid var(--accent);
  margin: 0.4rem 0 0.4rem 1rem;
  padding-left: 0.6rem;
}
.rmp-lane-address .rmp-route {
  margin: 0.4rem 0;
}
.rmp-bytes-changed td:not(:first-child) {
  font-weight: 700;
}
.rmp-win {
  border: 0;
  margin: 0.6rem 0 0;
  padding: 0;
}
.rmp-win label {
  align-items: center;
  display: inline-flex;
  gap: 0.4rem;
  margin-right: 1rem;
  white-space: nowrap;
}
.rmp-win input {
  height: 1.1rem;
  margin: 0;
  min-height: 0;
  padding: 0;
  width: 1.1rem;
}
.rmp-two {
  display: grid;
  gap: 0.8rem;
  grid-template-columns: repeat(auto-fit, minmax(min(16rem, 100%), 1fr));
}
.rmp-arrows {
  margin: 0;
  padding-left: 1.2rem;
}
.rmp-lane-path {
  display: grid;
  gap: 0.3rem;
  list-style: none;
  margin: 0 0 0.4rem;
  padding: 0;
}
/* Byte range beside the figure on a wide screen, under it on a phone. */
.rmp-figure-row {
  display: grid;
  gap: 1rem;
  grid-template-columns: minmax(0, 1fr);
}
@media (min-width: 64rem) {
  .rmp-figure-row {
    grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
  }
}
@media (max-width: 40rem) {
  .fig-table,
  .shared-page .fig-table {
    min-width: 0;
  }
  /* Six or more columns would wrap letter by letter: scroll in the labelled box instead. */
  .fig-table:has(th:nth-child(6)) {
    min-width: 40rem;
  }
}

/* The Passthrough chapter's figures (passthrough-figure.mjs). Not .viommu-map: that forces a 600 px minimum
   width, and these are drawn 340 wide so they read on a phone. */
.rmp-figure[data-lab-figure]:empty {
  display: none;
}
.pt-figure {
  width: 100%;
  height: auto;
  max-width: 22rem;
}
.pt-figure text {
  fill: var(--ink);
  font: 600 13px/1 system-ui, sans-serif;
  text-anchor: middle;
}
.pt-figure .pt-sub,
.pt-figure .pt-label {
  fill: var(--muted);
  font-weight: 400;
  font-size: 12px;
}
.pt-figure .pt-label {
  text-anchor: start;
}
.pt-figure rect {
  fill: var(--surface);
  stroke: var(--line, currentColor);
  stroke-width: 1.5;
}
.pt-figure .pt-track {
  fill: none;
}
.pt-figure path {
  fill: none;
  stroke: var(--line, currentColor);
  stroke-width: 2;
}
.pt-figure .pt-on rect {
  stroke: var(--accent);
  stroke-width: 3;
  fill: color-mix(in srgb, var(--accent) 16%, var(--surface));
}
.pt-figure .pt-skip rect {
  stroke-dasharray: 5 5;
}
.pt-figure .pt-skip text {
  fill: var(--muted);
}
.pt-figure .pt-start {
  text-anchor: start;
}
.pt-figure .pt-stop rect {
  stroke: var(--deny);
  stroke-width: 3;
  stroke-dasharray: 6 4;
}
.pt-figure .pt-stop path,
.pt-figure .pt-on path {
  stroke: currentColor;
}
.pt-cell,
.pt-unity {
  transform-box: fill-box;
  transform-origin: center;
}
