:root {
  --ink: #252c2b;
  --muted: #53635e;
  --line: #cfd5cc;
  --accent: #1d655c;
  --paper: #f8f8f2;
  color: var(--ink);
  background: var(--paper);
  font:
    15px/1.5 system-ui,
    sans-serif;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
header,
main {
  width: min(1330px, 94vw);
  margin: auto;
}
header {
  display: flex;
  gap: 13px;
  align-items: center;
  height: 58px;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
  color: var(--muted);
}
header a,
a {
  color: var(--accent);
}
header a {
  text-decoration: none;
}
header a:first-child {
  font-weight: 650;
  color: var(--ink);
}
.heading {
  margin: 34px 0 24px;
}
h1,
h2,
h3 {
  font-family: Georgia, serif;
  font-weight: 400;
  line-height: 1.12;
  margin: 0;
}
h1 {
  font-size: clamp(40px, 5vw, 74px);
  letter-spacing: -0.055em;
}
h1 i {
  color: var(--accent);
}
.heading p {
  color: var(--muted);
  margin: 9px 0 0;
}
.scales,
.modes,
.actions,
.viewtools {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
button,
select,
input,
textarea {
  font: inherit;
  color: inherit;
}
button,
select,
input,
textarea {
  border: 1px solid #bdc8bf;
  background: #fffefa;
  border-radius: 5px;
  padding: 7px 11px;
}
button,
select {
  cursor: pointer;
}
button:disabled {
  opacity: 0.55;
  cursor: default;
}
button:hover:not(:disabled) {
  border-color: var(--accent);
}
:focus-visible {
  outline: 3px solid #338f82;
  outline-offset: 2px;
}
.scales {
  border-bottom: 1px solid var(--line);
  gap: 20px;
}
.scales button,
.modes button {
  border: 0;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  background: none;
  padding: 8px 0;
}
.scales button[aria-pressed='true'],
.modes button[aria-pressed='true'] {
  color: var(--accent);
  border-color: var(--accent);
  font-weight: 650;
}
.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1.8fr) minmax(305px, 0.8fr);
  border-bottom: 1px solid var(--line);
}
figure {
  margin: 0;
  min-width: 0;
}
#stage {
  height: clamp(420px, 55vh, 700px);
  position: relative;
  isolation: isolate;
  overflow: hidden;
  background: radial-gradient(ellipse at 48% 45%, #fafaf4, #e9eee6);
  touch-action: none;
}
#stage canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  z-index: -1;
}
.viewtools {
  position: absolute;
  bottom: 14px;
  right: 16px;
  gap: 4px;
}
.viewtools button,
.viewtools select {
  font-size: 12px;
  background: #fafbf5eb;
}
.viewtools button {
  width: 33px;
}
.viewtools select {
  width: 117px;
}
#status {
  position: absolute;
  top: 14px;
  left: 16px;
  background: var(--paper);
  font-size: 13px;
  padding: 5px 9px;
  z-index: 1;
}
figcaption {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  padding: 10px 14px;
  color: var(--muted);
  font-size: 12px;
}
figcaption span:first-child {
  font-family: Georgia, serif;
  font-style: italic;
}
aside {
  padding: 12px 22px 20px;
  border-left: 1px solid var(--line);
}
.modes {
  gap: 16px;
  border-bottom: 1px solid var(--line);
  font-size: 14px;
  margin-bottom: 19px;
}
h2 {
  font-size: 28px;
  margin: 12px 0;
}
h3 {
  font-size: 23px;
  margin: 12px 0 6px;
}
.small,
.locator,
.count {
  font-size: 12px;
  color: var(--muted);
}
.count {
  font-variant-numeric: tabular-nums;
}
.field {
  display: grid;
  gap: 4px;
  margin: 10px 0;
  font-size: 13px;
  color: var(--muted);
}
select,
input,
textarea {
  width: 100%;
  min-width: 0;
}
.list {
  max-height: 180px;
  overflow: auto;
  border-block: 1px solid var(--line);
  margin: 8px 0;
}
.list button {
  display: block;
  text-align: left;
  width: 100%;
  border: 0;
  border-bottom: 1px solid #e1e5dc;
  background: none;
  border-radius: 0;
  font-size: 14px;
}
.list button[aria-pressed='true'] {
  background: #e0ede5;
  color: #174d46;
}
.primary {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}
.actions {
  margin: 12px 0;
}
.feedback {
  border-left: 3px solid var(--accent);
  padding-left: 11px;
  margin: 12px 0;
}
.credits {
  padding: 16px 0 26px;
  color: var(--muted);
  font-size: 13px;
}
.credits summary {
  cursor: pointer;
}
.credits div {
  max-width: 76ch;
}
.dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #168d81;
  margin-right: 6px;
}
.key {
  font-size: 12px;
}
textarea {
  resize: vertical;
}
.empty {
  font-style: italic;
  color: var(--muted);
}
[hidden] {
  display: none !important;
}
@media (max-width: 780px) {
  header,
  main {
    width: 94vw;
  }
  .heading {
    margin: 19px 0 15px;
  }
  .workspace {
    grid-template-columns: 1fr;
  }
  #stage {
    height: clamp(275px, 45vh, 450px);
  }
  aside {
    padding: 6px 7px 16px;
    border: 0;
    border-top: 1px solid var(--line);
  }
  figcaption {
    padding: 7px 2px;
  }
  .modes {
    margin-bottom: 10px;
  }
  .list {
    max-height: 140px;
  }
  .heading p {
    font-size: 14px;
  }
  .scales {
    gap: 17px;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    scroll-behavior: auto;
  }
}
.guide {
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
}
.guide h2 {
  margin: 0;
}
.guide .small {
  margin: 6px 0 10px;
}
.guide details {
  border-top: 1px solid var(--line);
  padding: 6px 0;
}
.guide summary {
  cursor: pointer;
  font-size: 16px;
  font-weight: 600;
}
.guide summary span {
  font-weight: 400;
  color: var(--muted);
  font-size: 12px;
  margin-left: 8px;
}
.guide ol {
  max-width: 86ch;
  padding-left: 24px;
}
.guide li {
  margin: 6px 0;
}
.guide li button {
  border: 0;
  padding: 0;
  background: none;
  text-align: left;
  color: var(--accent);
}
.guide li small {
  color: var(--muted);
  display: block;
}
.refs {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin: 8px 0;
  font-size: 12px;
}
.sources {
  padding: 20px 0;
  border-bottom: 1px solid var(--line);
}
.sources h2 {
  margin: 0;
}
.sources .small {
  margin: 6px 0 12px;
}
#source-library {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}
#source-library h3 {
  font-size: 18px;
}
#source-library button {
  width: 100%;
  text-align: left;
  margin: 3px 0;
  background: transparent;
  padding: 7px 9px;
}
#source-library small {
  display: block;
  color: var(--muted);
  font-size: 11px;
}
#reader {
  margin-top: 15px;
  border-top: 1px solid var(--line);
  scroll-margin: 12px;
}
#reader iframe {
  width: 100%;
  height: min(78vh, 880px);
  border: 1px solid var(--line);
  background: #f5f5ee;
}
#course-reading {
  min-height: 240px;
  padding: 28px;
  background: #edf2ea;
}
.refs button {
  color: var(--accent);
  font-size: 12px;
}
.course-filter {
  max-width: 36rem;
}
@media (max-width: 700px) {
  #source-library {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
.course-figure img {
  display: block;
  width: 100%;
  max-height: 550px;
  object-fit: contain;
  background: white;
  margin-top: 12px;
}
.course-figure figcaption {
  font-size: 12px;
}
.course-figure figcaption a {
  margin-left: 10px;
}
