:root {
  --paper: #f7f8f4;
  --ink: #25302c;
  --muted: #5b6963;
  --line: #d7dcd3;
  --green: #315d48;
  --terra: #9b5037;
  color-scheme: light;
  font:
    16px/1.55 'Source Sans 3',
    'PingFang SC',
    'Microsoft YaHei',
    sans-serif;
  color: var(--ink);
  background: var(--paper);
  font-variant-numeric: tabular-nums;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
body.stage-expanded {
  overflow: hidden;
}
button,
select {
  font: inherit;
  color: inherit;
}
button,
summary,
select {
  cursor: pointer;
}
button {
  border: 1px solid var(--line);
  background: #fffefa;
  border-radius: 6px;
}
button:hover,
select:hover {
  border-color: var(--green);
}
:focus-visible {
  outline: 3px solid #aa623b;
  outline-offset: 3px;
}
.masthead {
  position: sticky;
  top: 0;
  z-index: 30;
  min-height: 56px;
  height: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: #24372d;
  color: white;
  padding: 8px clamp(16px, 2.2vw, 32px);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.06),
    0 4px 12px rgba(20, 34, 26, 0.14);
}
.masthead strong {
  font-size: 18px;
  letter-spacing: 0.03em;
  white-space: nowrap;
  flex: none;
}
.room-nav {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  overflow-x: auto;
  scrollbar-width: none;
  padding: 3px 2px;
}
.room-nav::-webkit-scrollbar {
  display: none;
}
.room-nav a {
  flex: none;
  display: inline-flex;
  align-items: center;
  padding: 5px 8px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.05);
  color: #dde5dc;
  font-size: 12.5px;
  font-weight: 500;
  line-height: 1.35;
  letter-spacing: 0.01em;
  text-decoration: none;
  white-space: nowrap;
  transition:
    background 0.14s,
    border-color 0.14s,
    color 0.14s;
}
.room-nav a:hover {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(223, 205, 176, 0.55);
  color: #fff;
}
.room-nav a[aria-current='page'] {
  background: #366b51;
  border-color: #dfcdb0;
  color: #fff;
  font-weight: 600;
}
.room-nav a:focus-visible,
.masthead .back-home:focus-visible {
  outline: 2px solid #e7b66b;
  outline-offset: 2px;
}
.back-home {
  flex: none;
  border: 1px solid #819486;
  color: inherit;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.06);
  text-decoration: none;
  padding: 5px 12px;
  white-space: nowrap;
  font-size: 13px;
}
.back-home:hover {
  background: #49624f;
}
main,
footer {
  max-width: 1580px;
  margin: 0 auto;
  padding-inline: clamp(16px, 4.5vw, 75px);
}
.context {
  display: flex;
  gap: 10px;
  align-items: center;
  color: var(--muted);
  font-size: 12px;
  margin: 25px 0 7px;
}
.context i {
  color: #8a968d;
  font-style: normal;
}
.intro {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
}
h1,
h2,
h3,
p,
dl,
dd {
  margin: 0;
}
h1 {
  font-size: clamp(28px, 3vw, 44px);
  font-weight: 660;
  line-height: 1.24;
  letter-spacing: -0.03em;
}
.intro p {
  color: var(--muted);
  font-size: 14px;
  margin-top: 8px;
  max-width: 70em;
}
.edition {
  color: var(--green);
  border: 1px solid #bcccbf;
  border-radius: 4px;
  padding: 3px 10px;
  white-space: nowrap;
  font:
    14px/1.5 'IBM Plex Mono',
    monospace;
}
#stats {
  display: flex;
  gap: clamp(12px, 4vw, 65px);
  flex-wrap: wrap;
  margin: 20px 0;
  padding: 14px 0;
  border-block: 1px solid var(--line);
}
#stats dt {
  color: var(--muted);
  font-size: 12px;
}
#stats dd {
  font-size: clamp(16px, 1.5vw, 22px);
  font-weight: 550;
  letter-spacing: 0.01em;
}
.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) clamp(262px, 23vw, 336px);
  gap: 22px;
  align-items: start;
}
.drawing,
aside {
  min-width: 0;
}
.stage {
  position: relative;
  height: clamp(420px, 54vh, 710px);
  background: #e5e9e2;
  border: 1px solid #c9d1c5;
  border-radius: 10px;
  overflow: hidden;
  isolation: isolate;
}
.stage.expanded {
  position: fixed;
  inset: 0;
  z-index: 45;
  border-radius: 0;
  height: 100dvh;
  width: 100vw;
}
.stage:fullscreen {
  width: 100vw;
  height: 100vh;
  border-radius: 0;
}
#canvas,
#annotations {
  position: absolute;
  inset: 0;
}
#canvas canvas {
  display: block;
  touch-action: none;
  width: 100%;
  height: 100%;
}
.stage-head,
.stage-foot {
  position: absolute;
  left: 14px;
  right: 14px;
  display: flex;
  align-items: center;
  gap: 7px;
  pointer-events: none;
  z-index: 2;
}
.stage-head {
  top: 14px;
  justify-content: space-between;
}
.stage-foot {
  bottom: 12px;
  justify-content: flex-end;
}
.stage-head span,
.stage-foot button,
.gesture,
.screen-home {
  background: #fffefaef;
  backdrop-filter: blur(4px);
  border: 1px solid #d0d7cc;
  border-radius: 6px;
  padding: 6px 10px;
  font-size: 12px;
  box-shadow: 0 1px 6px #26392e12;
}
.stage-foot button:hover {
  border-color: var(--green);
}
.stage-foot button[aria-pressed='true'] {
  background: var(--green);
  border-color: var(--green);
  color: #fff;
}
.stage-head span:before {
  content: '';
  vertical-align: middle;
  display: inline-block;
  margin-right: 8px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
}
.stage-foot button,
.screen-home {
  pointer-events: auto;
}
.gesture {
  margin-right: auto;
  color: #46574b;
}
.screen-home {
  display: none;
}
.stage:fullscreen .screen-home,
.stage.expanded .screen-home {
  display: block;
}
.stage .screen-home:hover {
  background: #e4ebe2;
}
.labels {
  position: absolute;
  transform: translate(-50%, -50%);
  font:
    550 11px/1.35 'IBM Plex Mono',
    'Microsoft YaHei',
    sans-serif;
  white-space: nowrap;
  color: #fff;
  padding: 3px 6px;
  background: #345546eb;
  border: 1px solid #ffffff80;
  border-radius: 3px;
}
.labels[hidden] {
  display: none;
}
#annotations {
  pointer-events: none;
  overflow: hidden;
}
.view-selection,
.notes,
aside > section,
aside > details {
  background: #fffefa;
  border: 1px solid var(--line);
  border-radius: 8px;
}
.view-selection {
  margin-top: 12px;
  padding: 16px;
}
.buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}
.buttons button {
  font-size: 13px;
  padding: 6px 10px;
}
.buttons button[aria-pressed='true'] {
  background: var(--green);
  color: white;
  border-color: var(--green);
}
h2,
h3 {
  font-size: 16px;
  font-weight: 650;
  letter-spacing: 0.015em;
}
.view-selection h2,
.controls h2 {
  margin-bottom: 12px;
}
aside {
  display: grid;
  gap: 12px;
}
.controls,
#passage {
  padding: 15px 17px;
}
.option-row,
.select-row {
  padding: 9px 0;
  border-top: 1px solid #e9ece5;
}
.switch {
  display: flex;
  align-items: center;
  gap: 12px;
  justify-content: space-between;
  padding: 7px 0;
  border: 0;
  border-top: 1px solid #e9ece5;
  border-radius: 0;
  background: none;
  width: 100%;
  text-align: left;
  font-size: 13px;
}
.switch:hover {
  border-top-color: #e9ece5;
}
.switch:hover span {
  color: var(--green);
}
.switch > i {
  width: 30px;
  height: 17px;
  border-radius: 14px;
  background: #d2d7d1;
  position: relative;
  flex: none;
}
.switch > i:after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 11px;
  height: 11px;
  background: white;
  border-radius: 50%;
  transition: transform 0.16s;
}
.switch[aria-pressed='true'] > i {
  background: var(--green);
}
.switch[aria-pressed='true'] > i:after {
  transform: translateX(13px);
}
.option-label,
.select-row label {
  display: block;
  font-size: 13px;
  font-weight: 560;
  color: var(--ink);
  margin-bottom: 7px;
}
.option-group {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.option-group.option-grid-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.option-group.option-stack {
  display: flex;
  flex-direction: column;
}
.option-btn {
  flex: 1 1 auto;
  min-width: 0;
  padding: 6px 9px;
  font-size: 12.5px;
  line-height: 1.4;
  text-align: center;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fffefa;
  color: var(--ink);
  transition:
    background 0.14s,
    border-color 0.14s,
    color 0.14s;
}
.option-group.option-stack .option-btn {
  flex: none;
  width: 100%;
  text-align: left;
  padding: 7px 10px;
}
.option-btn:hover {
  border-color: var(--green);
  background: #f2f7f4;
}
.option-btn[aria-pressed='true'] {
  background: var(--green);
  border-color: var(--green);
  color: #fff;
  font-weight: 550;
}
.select-row select {
  width: 100%;
  background: white;
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 5px 6px;
  font-size: 13px;
}
.controls :is(.switch, .option-row, .select-row):first-child {
  border-top: 0;
  padding-top: 0;
}
.switch[hidden],
.option-row[hidden] {
  display: none;
}
.notes {
  margin-top: 12px;
}
.notes ul {
  margin: 0;
  padding: 0 28px 18px 35px;
}
.notes li,
.fine {
  font-size: 13px;
  color: var(--muted);
}
details summary {
  padding: 13px 16px;
  font-weight: 620;
}
#audit summary {
  color: var(--green);
  display: flex;
  align-items: baseline;
  gap: 6px 10px;
  flex-wrap: wrap;
  list-style: none;
}
#audit summary::-webkit-details-marker {
  display: none;
}
#audit summary::before {
  content: '▸';
  font-size: 12px;
  flex: none;
}
#audit[open] summary::before {
  content: '▾';
}
#counts {
  margin-left: auto;
  font:
    12px/1.6 'IBM Plex Mono',
    monospace;
}
#checks {
  margin: 0 0 10px;
  padding: 0 16px;
  list-style: none;
  max-height: 48vh;
  overflow: auto;
}
#checks li {
  padding: 9px 0;
  border-top: 1px solid var(--line);
  font-size: 13px;
}
#checks small {
  display: block;
  color: var(--muted);
  margin-top: 3px;
}
#checks b {
  font: 11px/1.4 monospace;
  padding: 2px 4px;
  background: #e9f1e9;
  color: #2d6146;
  border-radius: 3px;
  margin-right: 6px;
}
#checks [data-status='WARN'] b {
  color: #8a4d22;
  background: #f9eeda;
}
#checks [data-status='FAIL'] b {
  color: #993627;
  background: #f8e6e0;
}
#passage svg {
  width: 100%;
  height: 170px;
  display: block;
  background: #f5f5ef;
  border-radius: 4px;
  margin: 10px 0;
}
#passage[hidden] {
  display: none;
}
.passage-value {
  font-size: 14px;
  color: var(--terra);
  font-weight: 600;
}
.fine {
  margin-top: 5px;
}
footer {
  display: flex;
  justify-content: space-between;
  margin-top: 35px;
  margin-bottom: 24px;
  color: var(--muted);
  font-size: 12px;
}
footer span {
  font-family: monospace;
}
@media (max-width: 1260px) {
  .masthead {
    flex-wrap: wrap;
    row-gap: 6px;
    padding: 8px clamp(14px, 2vw, 24px) 6px;
  }
  .room-nav {
    order: 3;
    flex: 1 0 100%;
    max-width: 100%;
    gap: 4px;
    padding: 6px 2px 3px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
  }
  .room-nav a {
    padding: 4px 7px;
    font-size: 12px;
  }
}
@media (max-width: 800px) {
  .workspace {
    grid-template-columns: minmax(0, 1fr) 232px;
    gap: 12px;
  }
  .stage {
    height: 52vh;
    min-height: 340px;
  }
  .stage-foot .gesture {
    display: none;
  }
}
@media (max-width: 780px) {
  .room-nav {
    justify-content: flex-start;
  }
}
@media (max-width: 725px) {
  .masthead {
    min-height: 0;
    height: auto;
    padding: 8px 12px 6px;
    gap: 6px 8px;
  }
  .masthead strong {
    font-size: 15px;
  }
  .masthead .back-home {
    padding: 4px 10px;
    font-size: 12px;
  }
  .room-nav {
    flex-wrap: nowrap;
    gap: 5px;
    padding: 5px 2px 3px;
    -webkit-overflow-scrolling: touch;
  }
  .room-nav a {
    padding: 4px 8px;
    font-size: 12px;
  }
  .workspace {
    display: flex;
    flex-direction: column;
  }
  .drawing,
  aside {
    width: 100%;
  }
  .context {
    margin-top: 17px;
  }
  .intro {
    gap: 8px;
  }
  .edition {
    font-size: 12px;
  }
  .intro p {
    font-size: 13px;
  }
  #stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 6px 16px;
    margin: 12px 0;
    padding: 8px 0;
  }
  #stats dt {
    font-size: 11px;
  }
  .stage {
    height: 44dvh;
    min-height: 285px;
  }
  .stage-head {
    left: 8px;
    right: 8px;
    top: 8px;
  }
  .view-selection {
    padding: 10px;
  }
  .view-selection h2 {
    margin-bottom: 6px;
  }
  .buttons {
    gap: 5px;
  }
  .buttons button {
    padding: 5px 8px;
    font-size: 12px;
  }
  .stage.expanded,
  .stage:fullscreen {
    height: 100dvh;
  }
  footer {
    gap: 10px;
  }
  .labels {
    font-size: 10px;
  }
}
