:root {
  color-scheme: light;
  --bg: #f7f5f0;
  --panel: #eeece6;
  --text: #292d2a;
  --muted: #61675f;
  --line: #d8dcd2;
  --accent: #526442;
  --active: #e4e9db;
  --white: #fdfcf8;
  --warn: #ece5d7;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font:
    15px/1.6 -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
}
a {
  color: inherit;
  text-underline-offset: 4px;
}
button,
input {
  font: inherit;
}
button {
  cursor: pointer;
  color: inherit;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 8px 12px;
  min-height: 42px;
}
button:hover {
  background: var(--active);
}
button:focus-visible,
a:focus-visible,
input:focus-visible,
#viewer:focus-visible,
summary:focus-visible {
  outline: 3px solid #8b699f;
  outline-offset: 3px;
}
button[aria-pressed="true"] {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--white);
}
[hidden] {
  display: none !important;
}
header {
  height: 76px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 1500px;
  margin: auto;
  padding: 0 32px;
  border-bottom: 1px solid var(--line);
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  font-weight: 650;
}
.brand img {
  width: 28px;
}
header nav {
  display: flex;
  align-items: center;
  gap: 26px;
}
header nav a {
  font-size: 13px;
  text-decoration: none;
}
#theme {
  border: 0;
  font-size: 23px;
}
.intro {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  padding: 38px 0 26px;
  gap: 24px;
}
.eyebrow {
  font-size: 10px;
  letter-spacing: 0.18em;
  font-weight: 650;
  color: var(--accent);
  margin: 0 0 10px;
}
h1,
h2,
h3,
p {
  margin-top: 0;
}
h1 {
  font-family: Georgia, serif;
  font-size: clamp(32px, 3.3vw, 52px);
  font-weight: 400;
  line-height: 1.1;
  letter-spacing: -0.04em;
  margin-bottom: 0;
}
.intro > p {
  color: var(--muted);
  font-size: 14px;
  margin: 0 4px 0 0;
}
main {
  max-width: 1500px;
  padding: 0 32px;
  margin: auto;
}
.workspace {
  display: grid;
  grid-template-columns: 190px minmax(280px, 1fr) 330px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  min-height: 660px;
}
.groups {
  padding: 24px 18px 20px 0;
}
.groups h2 {
  font-size: 15px;
  margin-bottom: 3px;
}
.muted {
  color: var(--muted);
}
.small {
  font-size: 11px;
}
.search-label {
  display: block;
  font-size: 11px;
  margin-top: 20px;
  margin-bottom: 5px;
}
input[type="search"] {
  width: 100%;
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--line);
  padding: 8px 0;
  font-size: 11px;
  color: var(--text);
  border-radius: 0;
}
#groups {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-top: 15px;
  max-height: 480px;
  overflow: auto;
  padding-right: 4px;
}
#groups button {
  text-align: left;
  border: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-radius: 5px;
  font-size: 12px;
  min-height: 32px;
  padding: 6px 10px;
}
#groups button span {
  font-size: 10px;
  opacity: 0.7;
}
.atlas {
  background: var(--panel);
  position: relative;
  min-width: 0;
  padding: 18px 20px 14px;
  display: flex;
  flex-direction: column;
}
.atlas-top {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  gap: 10px;
}
#viewer {
  width: 100%;
  height: 485px;
  flex: 1;
  position: relative;
  min-height: 380px;
  touch-action: none;
}
canvas {
  display: block;
  width: 100%;
  height: 100%;
}
#loading {
  position: absolute;
  inset: 0;
  display: grid;
  align-content: center;
  justify-content: center;
  padding: 32px;
  color: var(--muted);
  text-align: center;
  font-size: 13px;
}
.view-controls {
  display: flex;
  justify-content: center;
  gap: 5px;
  flex-wrap: wrap;
}
.view-controls button {
  font-size: 10px;
  padding: 5px 9px;
  min-height: 36px;
}
.layer-controls {
  display: flex;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
  margin: 14px 0 6px;
  font-size: 10px;
}
.layer-controls label {
  display: flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
}
input[type="checkbox"] {
  accent-color: var(--accent);
}
.atlas-note {
  font-size: 9px;
  color: var(--muted);
  text-align: center;
  margin: 4px 0;
  line-height: 1.5;
}
.lesson {
  padding: 24px 0 14px 26px;
  min-width: 0;
}
.lesson h2 {
  font-family: Georgia, serif;
  font-size: 29px;
  line-height: 1.13;
  font-weight: 400;
  letter-spacing: -0.025em;
  margin: 16px 0 10px;
}
.area-tabs {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}
.area-tabs button {
  font-size: 10px;
  padding: 5px 8px;
  min-height: 32px;
}
.tool {
  font-size: 11px;
  color: var(--accent);
  font-weight: 600;
  margin-bottom: 20px;
}
.steps {
  display: flex;
  gap: 3px;
}
.steps button {
  font-size: 10px;
  padding: 6px 9px;
  min-height: 34px;
  border: 0;
  border-bottom: 2px solid var(--line);
  border-radius: 0;
  flex: 1;
}
.steps button[aria-pressed="true"] {
  color: var(--accent);
  background: transparent;
  border-bottom-color: var(--accent);
}
#instruction {
  font-size: 12px;
  line-height: 1.65;
  min-height: 82px;
  margin: 14px 0 5px;
}
.video-placeholder {
  width: 100%;
  min-width: 0;
  min-height: 190px;
  aspect-ratio: 16 / 9;
  padding: 24px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  text-align: center;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
}
.video-placeholder svg {
  flex-shrink: 0;
  color: var(--accent);
}
.video-placeholder h3 {
  margin: 0;
  font-size: 16px;
  line-height: 1.3;
}
.video-placeholder p {
  max-width: 28ch;
  margin: 0;
  font-size: 12px;
  line-height: 1.6;
  color: var(--muted);
}
.primary {
  background: var(--accent);
  color: var(--white);
  border-color: var(--accent);
  font-size: 11px;
  width: 100%;
}
.primary:hover {
  filter: brightness(1.1);
  background: var(--accent);
}
.caution {
  margin: 16px 0 0;
  padding: 12px;
  background: var(--warn);
  border-radius: 5px;
}
.caution h3 {
  font-size: 10px;
  margin-bottom: 5px;
}
.caution p {
  font-size: 10px;
  line-height: 1.6;
  margin: 0;
}
.lesson-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 12px;
  gap: 4px;
}
.lesson-footer button {
  font-size: 10px;
  border: 0;
  padding: 5px;
}
.lesson-footer span {
  font-size: 10px;
  color: var(--muted);
}
.foundation {
  padding: 70px 0;
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 60px;
}
.foundation h2 {
  font:
    400 40px/1.15 Georgia,
    serif;
  letter-spacing: -0.035em;
}
.foundation h3 {
  font-size: 13px;
  margin-bottom: 8px;
}
.foundation p {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 24px;
}
.foundation a {
  font-size: 12px;
}
.sources {
  border-top: 1px solid var(--line);
  padding: 20px 0 30px;
  color: var(--muted);
  font-size: 11px;
}
.sources summary {
  cursor: pointer;
  color: var(--text);
  margin-bottom: 15px;
}
.sources p {
  max-width: 960px;
}
footer {
  max-width: 1500px;
  padding: 25px 32px;
  margin: auto;
  border-top: 1px solid var(--line);
  display: flex;
  gap: 30px;
  font-size: 11px;
  color: var(--muted);
}
footer span {
  margin-left: auto;
}
.skip {
  position: fixed;
  top: -100px;
  left: 20px;
  z-index: 20;
  background: var(--bg);
  padding: 10px;
}
.skip:focus {
  top: 10px;
}
.no-js {
  padding: 24px;
}
.error-link {
  margin-top: 10px;
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #222820;
  --panel: #2a3028;
  --text: #e7e9df;
  --muted: #b1b9a9;
  --line: #444c3d;
  --accent: #c3cfb0;
  --active: #424e37;
  --white: #242c1f;
  --warn: #3c3b2d;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #222820;
    --panel: #2a3028;
    --text: #e7e9df;
    --muted: #b1b9a9;
    --line: #444c3d;
    --accent: #c3cfb0;
    --active: #424e37;
    --white: #242c1f;
    --warn: #3c3b2d;
  }
}
@media (min-width: 1600px) {
  #viewer {
    min-height: 560px;
  }
}
@media (max-width: 1100px) {
  .workspace {
    grid-template-columns: 150px minmax(260px, 1fr) 290px;
  }
  .lesson {
    padding-left: 18px;
  }
  .atlas {
    padding-left: 10px;
    padding-right: 10px;
  }
  main {
    padding: 0 22px;
  }
  .foundation {
    gap: 30px;
  }
  .groups {
    padding-right: 10px;
  }
}
@media (max-width: 850px) {
  header {
    height: 64px;
    padding: 0 20px;
  }
  header nav {
    gap: 16px;
  }
  .brand {
    font-size: 13px;
  }
  main {
    padding: 0 20px;
  }
  .intro {
    padding: 28px 0 24px;
  }
  .intro > p {
    font-size: 12px;
  }
  .workspace {
    grid-template-columns: minmax(0, 1fr) 300px;
  }
  .groups {
    grid-column: 1/-1;
    padding: 16px 0;
  }
  .groups h2,
  .groups > .small,
  .search-label {
    display: none;
  }
  input[type="search"] {
    width: 220px;
  }
  #groups {
    flex-direction: row;
    overflow: auto;
    max-height: none;
    gap: 5px;
    margin-top: 12px;
    padding-bottom: 4px;
  }
  #groups button {
    white-space: nowrap;
    gap: 14px;
    min-height: 38px;
  }
  .atlas {
    min-height: 600px;
  }
  .foundation {
    grid-template-columns: 1fr 1fr;
  }
  .foundation > div:first-child {
    grid-column: 1/-1;
  }
  .foundation h2 br {
    display: none;
  }
}
@media (max-width: 620px) {
  header nav a:first-child {
    display: none;
  }
  .intro {
    display: block;
  }
  .intro > p {
    margin-top: 16px;
  }
  .intro > p br {
    display: none;
  }
  .workspace {
    display: flex;
    flex-direction: column;
  }
  .atlas {
    min-height: 0;
    padding: 16px 12px;
  }
  #viewer {
    height: 360px;
    min-height: 360px;
    flex: auto;
  }
  .lesson {
    padding: 26px 0 18px;
  }
  .lesson h2 {
    font-size: 32px;
  }
  .lesson .eyebrow {
    margin-bottom: 12px;
  }
  .area-tabs button {
    min-height: 40px;
    font-size: 12px;
  }
  #instruction {
    font-size: 14px;
    min-height: 70px;
  }
  .steps button {
    font-size: 12px;
    min-height: 44px;
  }
  .primary {
    font-size: 13px;
    min-height: 44px;
  }
  .caution h3 {
    font-size: 12px;
  }
  .caution p {
    font-size: 12px;
  }
  .lesson-footer button {
    font-size: 12px;
  }
  .foundation {
    display: block;
    padding: 42px 0 20px;
  }
  .foundation h2 {
    font-size: 36px;
  }
  .foundation h3 {
    font-size: 15px;
  }
  .foundation p {
    font-size: 13px;
  }
  footer {
    gap: 12px;
    flex-wrap: wrap;
    padding: 20px;
  }
  .sources {
    font-size: 12px;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation: none !important;
    transition: none !important;
  }
}
/* Let the anatomy and group list use the full teaching column on desktop. */
@media (min-width: 851px) {
  .groups {
    display: flex;
    flex-direction: column;
    min-height: 0;
  }
  #groups {
    flex: 1 1 0;
    min-height: 0;
    max-height: none;
  }
  #groups button {
    flex-shrink: 0;
  }
  .atlas {
    align-self: stretch;
  }
  #viewer {
    height: clamp(600px, 68vh, 820px);
    min-height: 600px;
    flex: 1;
  }
  .atlas {
    padding-bottom: 18px;
  }
}

/* Additional anatomy stays together within the existing group column. */
.other-groups {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex-shrink: 0;
  border-top: 1px solid var(--line);
  margin-top: 16px;
  padding-top: 14px;
}
.other-groups h3 {
  margin: 0 10px 4px;
  font-size: 12px;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.other-tool {
  margin: 0 10px 10px;
  font-size: 11px;
  line-height: 1.5;
  color: var(--accent);
  text-underline-offset: 3px;
}
@media (max-width: 850px) {
  .other-groups {
    display: grid;
    grid-template-rows: auto auto;
    grid-auto-flow: column;
    align-items: center;
    border-top: 0;
    border-left: 1px solid var(--line);
    margin: 0 0 0 8px;
    padding: 0 0 0 12px;
  }
  .other-groups h3 { grid-column: 1; grid-row: 1; }
  .other-tool { grid-column: 1; grid-row: 2; white-space: nowrap; margin-bottom: 0; }
  .other-groups button { grid-row: 1 / 3; }
}

header nav{flex-wrap:wrap}header nav a:first-child{display:inline}header{flex-wrap:wrap;row-gap:12px}
