:root {
  color-scheme: light;
  --ink: #1d3028;
  --muted: #56665a;
  --paper: #f3f1e9;
  --card: #fffcf3;
  --line: #c9ccbb;
  --forest: #163f30;
  --lime: #ddf88c;
  --mono: "IBM Plex Mono",Consolas,monospace;
  font-family: "DM Sans",system-ui,sans-serif;
  color: var(--ink);
  background: var(--paper);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
}

a {
  color: inherit;
}

button,select,textarea {
  font: inherit;
}

button,select {
  cursor: pointer;
}

button:focus-visible,a:focus-visible,select:focus-visible,textarea:focus-visible {
  outline: 3px solid #5179ab;
  outline-offset: 2px;
}

.mast {
  background: var(--ink);
  color: var(--card);
  border-bottom: 4px solid #bddd8c;
}

.mast-inner,main {
  max-width: 1136px;
  margin: auto;
  padding-inline: 32px;
}

.mast-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 61px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 730;
  text-decoration: none;
  letter-spacing: -.03em;
}

.weave {
  width: 23px;
  height: 23px;
  border-radius: 5px;
  background: repeating-linear-gradient(0deg,transparent 0 4px,var(--lime) 4px 6px),repeating-linear-gradient(90deg,transparent 0 4px,var(--lime) 4px 6px);
  transform: rotate(-8deg);
}

.mast-note,.policy,.capacity,.progress,.journal-note,.decoder-top>span {
  font: 12px var(--mono);
}

.mast-note {
  color: #d5decf;
}

main {
  padding-bottom: 55px;
}

.intro {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 34px 0 26px;
}

.intro h1 {
  font: normal clamp(3.2rem,7vw,5.4rem)/1.05 "Instrument Serif",Georgia,serif;
  letter-spacing: -.078em;
  margin: 0;
}

.intro h1 span {
  color: #a95125;
}

.intro p {
  color: var(--muted);
  margin: 8px 0 0;
}

.intro-motif {
  width: min(24vw,230px);
  height: 67px;
  color: #637755;
  background: repeating-linear-gradient(-55deg,transparent 0 5px,currentColor 5px 6px,transparent 6px 9px);
  clip-path: polygon(0 94%,23% 94%,23% 67%,46% 67%,46% 39%,69% 39%,69% 12%,100% 12%,100% 100%,0 100%);
}

.workbench {
  display: grid;
  grid-template-columns: minmax(250px,.77fr) minmax(0,1.6fr);
  gap: 16px;
}

.panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 23px;
}

h2 {
  font-size: 1.15rem;
  letter-spacing: -.035em;
  margin: 0;
}

.controls>label,legend {
  display: block;
  font-size: .84rem;
  font-weight: 700;
  margin: 16px 0 6px;
}

.controls select,.controls textarea {
  width: 100%;
  background: #fffef8;
  color: var(--ink);
  border: 1px solid #adb4a3;
  border-radius: 5px;
  padding: 8px;
}

.controls textarea {
  resize: vertical;
  min-height: 70px;
  font: 14px/1.5 var(--mono);
}

small,.capacity,.journal-note,.progress {
  color: var(--muted);
}

small {
  display: block;
  line-height: 1.4;
  font-size: .74rem;
}

fieldset {
  border: 0;
  margin: 16px 0 0;
  padding: 0;
}

legend {
  padding: 0;
  margin: 0 0 7px;
}

.selects {
  display: grid;
  grid-template-columns: repeat(3,1fr);
  gap: 8px;
}

.selects label {
  font-size: .76rem;
  color: var(--muted);
}

.selects select {
  margin-top: 3px;
}

.capacity {
  line-height: 1.5;
  margin: 8px 0 18px;
}

.actions {
  display: flex;
  gap: 6px;
}

.actions button {
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--ink);
  background: transparent;
  padding: 9px 12px;
  font-weight: 600;
}

.actions .primary {
  flex: 1;
  background: var(--forest);
  color: white;
  border-color: var(--forest);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.actions button:hover:enabled {
  filter: brightness(.94);
  box-shadow: inset 0 0 0 1px currentColor;
}

.actions button:disabled {
  opacity: .47;
  cursor: default;
}

.progress {
  display: flex;
  justify-content: space-between;
  margin-top: 15px;
}

progress {
  accent-color: var(--forest);
  width: 100%;
  height: 5px;
  display: block;
  margin-top: 8px;
}

.board-head,.decoder-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.policy {
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 4px 6px;
  color: var(--muted);
  font-size: .7rem;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(3,1fr);
  margin: 20px 0 15px;
  border-block: 1px solid var(--line);
  padding: 10px 0;
}

.metrics>div {
  padding-left: 16px;
  border-left: 1px solid var(--line);
}

.metrics>div:first-child {
  border: 0;
  padding: 0;
}

.metrics span {
  display: block;
  color: var(--muted);
  font-size: .76rem;
}

.metrics strong {
  font: 500 clamp(1.45rem,3vw,2.05rem)/1.25 var(--mono);
  letter-spacing: -.075em;
}

.gridwrap,.table-scroll {
  overflow-x: auto;
}

table {
  border-collapse: collapse;
  text-align: left;
  width: 100%;
  font: 13px/1.45 var(--mono);
}

th {
  font-weight: 500;
  color: var(--muted);
}

.cache {
  border-spacing: 5px;
  border-collapse: separate;
}

.cache th {
  white-space: nowrap;
  font-size: .73rem;
}

.cache thead th {
  text-align: center;
}

.cache td {
  text-align: center;
  border: 1px solid #cdd1bf;
  background: #f0f0e5;
  border-radius: 5px;
  padding: 8px 5px;
  font-size: .79rem;
  white-space: nowrap;
}

.cache td.blank {
  color: #707868;
  border-style: dashed;
  background: transparent;
}

.cache td.active {
  border: 2px solid var(--forest);
  background: #e0ecce;
  padding: 7px 4px;
  font-weight: 700;
}

.cache tbody th {
  width: 1%;
  padding-right: 6px;
}

.cache tr.selected th {
  color: var(--forest);
  font-weight: 750;
}

.readout {
  display: flex;
  gap: 10px;
  align-items: baseline;
  font-size: .83rem;
  line-height: 1.5;
  margin-top: 14px;
}

.readout b {
  font: 700 .75rem var(--mono);
  padding: 5px 8px;
  border-radius: 4px;
  background: #e3e6d7;
}

.readout b.hit,.tag.hit {
  background: #daf2b2;
  color: #284722;
}

.readout b.miss,.tag.miss {
  background: #ffe1cb;
  color: #723714;
}

#error {
  color: #922f24;
  font-size: .8rem;
}

.decoder {
  margin: 16px 0;
  padding: 23px;
  border-radius: 14px;
  background: #203e31;
  color: var(--card);
}

.decoder-top>span {
  color: #d6e7cb;
}

#bits {
  display: grid;
  grid-template-columns: minmax(0,2.4fr) minmax(0,1fr) minmax(0,1fr);
  gap: 10px;
  margin-top: 16px;
}

.field {
  border-top: 3px solid var(--field);
  padding-top: 8px;
  min-width: 0;
}

.field strong {
  display: block;
  font: 500 clamp(.96rem,2.6vw,1.6rem)/1.3 var(--mono);
  letter-spacing: .015em;
  color: var(--field);
  overflow-wrap: anywhere;
}

.field span {
  font: .74rem var(--mono);
  color: #e0e8db;
}

.journal table th,.journal table td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}

.journal table {
  margin-top: 12px;
}

.study { margin: 16px 0; }
.study h3 { font-size: 1rem; margin: 0; }
.study p { color: var(--muted); font-size: .85rem; line-height: 1.5; }
.study .study-note { color: var(--forest); font-weight: 650; }
.study button { background: var(--forest); color: white; border: 0; border-radius: 5px; padding: 8px 13px; }
.study button:disabled { opacity: .5; }
.study-tables { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; margin-top: 22px; }
.study-tables[hidden] { display: none; }
.study th,.study td { padding: 5px 8px; }
.study .current-config { outline: 1px solid var(--forest); }
.study .rate { background: linear-gradient(to right,#e3ebce var(--share),transparent var(--share)); }
@media(max-width:650px) { .study-tables { grid-template-columns: 1fr; } }

.tag {
  display: inline-block;
  border-radius: 4px;
  padding: 1px 5px;
}

.journal #empty {
  font-size: .87rem;
  color: var(--muted);
  margin: 14px 0 0;
}

.sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

@media(max-width:760px) {
  .mast-inner,main {
    padding-inline: 16px;
  }

  .workbench {
    grid-template-columns: 1fr;
  }

  .intro {
    padding: 24px 0 20px;
  }

  .intro-motif {
    width: 65px;
    flex: none;
  }

  .panel,.decoder {
    padding: 17px;
  }

  .cache th,.cache td {
    font-size: .72rem;
  }

  .intro p {
    font-size: .91rem;
  }

  #bits {
    gap: 7px;
  }

  .field span {
    font-size: .66rem;
  }

  .readout {
    margin-top: 10px;
  }

  .mast-inner {
    height: 52px;
  }

}

/* Type, navigation and rules shared by the research collection. */
:root {
  --book-ink: #193d32;
  --book-copper: #8e4b2b;
  --book-paper: #f7f4eb;
  --book-card: #fffdf7;
  --book-line: #c9c7b7;
  --book-serif: "Baskervville", "Baskerville Old Face", Georgia, "Songti SC", SimSun, serif;
  background: var(--book-paper);
  color: var(--book-ink);
}
.index-links {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 0 12px;
  border-bottom: 1px solid var(--book-line);
  color: #546259;
  font: 500 0.79rem/1.5 "DM Sans", "Segoe UI", system-ui, sans-serif;
}
.index-links a { color: inherit; text-decoration: none; }
.index-links a:hover { color: var(--book-copper); text-decoration: underline; text-underline-offset: 4px; }
.index-links a:focus-visible { outline: 2px solid var(--book-copper); outline-offset: 4px; }
.index-links a:last-child { text-align: right; }
::selection { background: #d6dfcf; color: #15382d; }

:root { --ink: var(--book-ink); --card: var(--book-card); --line: var(--book-line); --lime: #d5c7a0; }
.mast { border-bottom: 2px solid #b07b56; }
.brand { font: 400 1.4rem/1.15 var(--book-serif); letter-spacing: -.02em; }
.intro { padding-block: clamp(24px, 4vw, 44px) 28px; }
.intro h1 { font-family: var(--book-serif); letter-spacing: -.053em; }
.intro h1 span, .intro-motif { color: var(--book-copper); }
.panel, .decoder { border-radius: 3px; }
.board, .study { border-top: 3px solid var(--book-ink); }

.lab-controls { display:flex; flex-wrap:wrap; gap:1rem; }
.lab-controls label { display:grid; gap:.25rem; }
#block-relocation p { overflow-wrap:anywhere; }
