/* Gyro TQ visual explainer layout additions (tokens from pastel-labs.css) */
.deck-main,
.deck-sheet,
.panel,
.table-wrap {
  max-width: 100%;
}

code {
  font-family: var(--font-mono);
  font-size: 0.9em;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.meta-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.25rem;
  margin: 1.1rem 0 0;
  padding: 0.75rem 0;
  border: 0;
  border-top: 1px solid var(--hairline);
  border-bottom: 1px solid var(--hairline);
  border-radius: 0;
  background: transparent;
  font-size: 0.92rem;
  color: var(--ink-2);
}

.meta-chip {
  display: inline-block;
  padding: 0.15rem 0.55rem;
  border: 1px solid var(--hairline);
  border-radius: 3px;
  background: var(--stock);
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 0.84rem;
}

.fig-meta {
  font-family: var(--font-mono);
  font-size: 0.84rem;
  color: var(--margin-ink);
  margin: 0 0 0.25rem;
}

.fig-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem 1.25rem;
  margin-bottom: 0.85rem;
}

.fig-head h3 {
  margin: 0;
}

.presets {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.fig-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  align-items: center;
  margin: 0.75rem 0;
}

.fig-controls select,
.fig-controls input[type="number"] {
  min-height: 3rem;
  padding: 0.55rem 0.8rem;
  max-width: 100%;
}

.fig-canvas {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  border: 1px solid var(--hairline);
  border-radius: 3px;
  background: var(--unprinted-stock);
}

.readout-dl {
  display: grid;
  grid-template-columns: minmax(9.5rem, 14.5rem) 1fr;
  gap: 0.45rem 1.15rem;
  margin: 1rem 0 0;
  padding: 0.85rem 0;
  border: 0;
  border-top: 1px solid var(--hairline);
  border-bottom: 1px solid var(--hairline);
  border-radius: 0;
  background: transparent;
  font-size: 0.94rem;
}

.readout-dl dt {
  font-weight: 600;
  color: var(--ink-2);
}

.readout-dl dd {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 0.88rem;
  color: var(--ink);
  overflow-wrap: anywhere;
}

.mini-box {
  margin-top: 1rem;
  padding-top: 0.9rem;
  border-top: 1px solid var(--hairline);
  font-size: 0.94rem;
}

.mini-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr));
  gap: 0.65rem;
  margin: 0.6rem 0 0;
  padding: 0;
  list-style: none;
}

.mini-list li {
  padding: 0.8rem 0.95rem;
  border: 1px solid var(--hairline);
  border-radius: 3px;
  background: var(--stock);
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 0.82rem;
}

.mini-list li.active-mini {
  border-color: var(--vermilion);
  box-shadow: inset 0 0 0 1px var(--vermilion);
}

.mini-list li strong {
  display: block;
  font-family: var(--font-body);
  font-size: 0.88rem;
  margin-bottom: 0.2rem;
  color: var(--ink);
}

.slider-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex: 1 1 14rem;
  min-height: 3rem;
  padding: 0.5rem 0;
  border: 0;
  border-top: 1px solid var(--hairline);
  border-bottom: 1px solid var(--hairline);
  border-radius: 0;
  background: transparent;
  color: var(--ink);
  max-width: 100%;
}

.slider-row label {
  font-family: var(--font-mono);
  font-size: 0.84rem;
  color: var(--ink);
}

.slider-row input[type="range"] {
  width: 100%;
  accent-color: var(--vermilion);
  cursor: pointer;
}

.cb-layout {
  display: flex;
  flex-wrap: wrap;
  gap: 1.15rem;
  align-items: flex-start;
  margin-top: 0.85rem;
}

.cb-col-text {
  flex: 1 1 18rem;
  min-width: 0;
  max-width: 100%;
}

.cb-col-plot {
  flex: 1 1 15rem;
  min-width: 0;
  max-width: 100%;
}

.swatch-dot {
  display: inline-block;
  width: 0.65rem;
  height: 0.65rem;
  border-radius: 50%;
  margin-right: 0.4rem;
  vertical-align: middle;
}

.cache-meter {
  margin-top: 1rem;
  padding-top: 0.9rem;
  border-top: 1px solid var(--hairline);
}

.cache-row {
  margin-bottom: 0.65rem;
  font-size: 0.9rem;
}

.cache-row-top {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.35rem 0.65rem;
  margin-bottom: 0.25rem;
  color: var(--ink);
}

.cache-row-top code {
  font-family: var(--font-mono);
}

.cache-bar-bg {
  height: 0.65rem;
  background: var(--stock);
  border: 1px solid var(--hairline);
  border-radius: 2px;
  overflow: hidden;
}

.cache-bar-fg {
  height: 100%;
}

.table-wrap {
  overflow-x: auto;
  margin: 0.85rem 0 0.6rem;
  -webkit-overflow-scrolling: touch;
}

.table-wrap table {
  margin: 0;
}

tr.highlight td {
  background: color-mix(in srgb, var(--ochre) 16%, transparent);
  font-weight: 600;
}


dl.glossary {
  display: grid;
  grid-template-columns: minmax(9rem, 14rem) 1fr;
  gap: 0.55rem 1.25rem;
  margin: 0.5rem 0 0.75rem;
  font-size: 0.98rem;
}
dl.glossary dt {
  font-weight: 600;
  color: var(--ink);
}
dl.glossary dd {
  margin: 0;
  color: var(--ink);
}
.card-stack {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.85rem;
  margin: 0.85rem 0 1.1rem;
}
.card-stack .card {
  margin: 0;
  padding: 0.85rem 0 0.35rem;
  border: 0;
  border-top: 1.5px solid var(--hairline);
  border-radius: 0;
  background: transparent;
}
.card-stack .card h3 {
  margin: 0 0 0.4rem;
  font-size: 1.14rem;
}
.card-stack .card p {
  margin: 0;
}

.bridge {
  margin-top: 2rem;
  padding: 1rem 0 0.25rem;
  border: 0;
  border-top: 2px solid var(--ochre);
  border-bottom: 1px solid var(--hairline);
  border-radius: 0;
  background: transparent;
}

.bridge p {
  margin: 0;
}

@media (max-width: 44rem) {
  :root {
    --frame: calc(100% - 1.25rem);
  }
  .deck-header {
    padding-top: 0.9rem;
    gap: 0.5rem 1rem;
  }
  .deck-nav {
    gap: 0.25rem 0.85rem;
  }
  .deck-sheet {
    margin: 0.75rem auto 1.25rem;
    padding: 1.2rem 0.95rem 1.45rem;
  }
  h1 {
    font-size: 1.7rem;
    line-height: 1.14;
  }
  h2 {
    font-size: 1.32rem;
    margin-top: 1.6rem;
  }
  h3 {
    font-size: 1.1rem;
  }
  .panel {
    padding: 0.95rem 0.85rem;
    margin: 1.1rem 0 1rem;
  }
  .presets {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.45rem;
  }
  .presets button {
    font-size: 0.88rem;
    padding: 0.5rem 0.55rem;
    min-height: 3rem;
  }
  dl.glossary {
    grid-template-columns: 1fr;
    gap: 0.15rem;
  }
  dl.glossary dd {
    margin-bottom: 0.6rem;
  }
  .readout-dl {
  display: grid;
  grid-template-columns: minmax(9.5rem, 14.5rem) 1fr;
  gap: 0.45rem 1.15rem;
  margin: 1rem 0 0;
  padding: 0.85rem 0;
  border: 0;
  border-top: 1px solid var(--hairline);
  border-bottom: 1px solid var(--hairline);
  border-radius: 0;
  background: transparent;
  font-size: 0.94rem;
}
  .readout-dl dd {
    margin-bottom: 0.45rem;
  }
  .slider-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex: 1 1 14rem;
  min-height: 3rem;
  padding: 0.5rem 0;
  border: 0;
  border-top: 1px solid var(--hairline);
  border-bottom: 1px solid var(--hairline);
  border-radius: 0;
  background: transparent;
  color: var(--ink);
  max-width: 100%;
}
  .mini-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .cb-col-text,
  .cb-col-plot {
    flex: 1 1 100%;
  }
  .table-wrap table,
  .table-wrap tbody {
    display: block;
    width: 100%;
  }
  .table-wrap thead {
    display: none;
  }
  .table-wrap tbody tr {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.35rem 0.75rem;
    padding: 0.75rem 0.85rem;
    margin-bottom: 0.65rem;
    border: 1px solid var(--hairline);
    border-radius: 3px;
    background: var(--unprinted-stock);
  }
  .table-wrap tbody tr.highlight {
    background: color-mix(in srgb, var(--ochre) 16%, transparent);
    border-color: var(--ochre);
  }
  .table-wrap tbody td,
  .table-wrap tbody tr.highlight td {
    display: block;
    padding: 0;
    border: 0;
    background: transparent;
    text-align: left;
    font-size: 0.88rem;
    white-space: normal;
    overflow-wrap: anywhere;
  }
  .table-wrap tbody td:first-child {
    grid-column: 1 / -1;
    padding-bottom: 0.3rem;
    margin-bottom: 0.15rem;
    border-bottom: 1px solid var(--hairline);
    font-size: 0.96rem;
    font-weight: 600;
  }
  .table-wrap tbody td::before {
    content: attr(data-label);
    display: block;
    font-family: var(--font-body);
    font-size: 0.76rem;
    font-weight: 600;
    color: var(--ink-2);
  }
  .table-wrap tbody td:first-child::before {
    display: none;
  }
}

/* Measure and heading balance rules */
h1, h2, h3, h4, .panel-title, .fig-head h3 {
  text-wrap: balance;
}
p, li, dd, .lede, .lede p, .prose p, .card p, .bridge p, .note, .panel-sub, .step-tag {
  max-width: 58ch;
  text-wrap: pretty;
}
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  gap: 1.25rem;
  margin: 0.85rem 0 1.1rem;
}
.card-grid .card {
  margin: 0;
  padding: 0.85rem 0 0.35rem;
  border: 0;
  border-top: 1.5px solid var(--hairline);
  border-radius: 0;
  background: transparent;
}
