:root {
  color-scheme: light;
  font-family: Arial, sans-serif;
  color: #212542;
  background: #edf0f7;
  --navy: #21205a;
  --blue: #e6eeff;
  --prompt: #f6e8ec;
}
* { box-sizing: border-box; }
body { margin: 0; }
.app { display: flex; flex-direction: column; height: 100vh; height: 100dvh; }
header { background: var(--navy); color: #fff; padding: 12px 24px; }
header p { margin: 0 0 4px; color: #e5e6ff; font-size: 13px; }
header h1 { margin: 0; font-size: clamp(17px, 2.25vw, 24px); }
.toolbar, .navigation {
  display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center;
  justify-content: center; padding: 8px 12px; background: #fff;
}
.toolbar { border-bottom: 1px solid #d9deeb; }
.navigation { border-top: 1px solid #d9deeb; }
.group { display: flex; flex-wrap: wrap; gap: 5px; align-items: center; }
button {
  min-height: 36px; border: 1px solid #bec6db; border-radius: 8px;
  background: #fff; color: var(--navy); padding: 5px 11px;
  font: 600 14px Arial, sans-serif; cursor: pointer;
}
button:hover:not(:disabled) { background: #edf2ff; }
button[aria-pressed="true"], button[aria-current="step"] {
  border-color: var(--navy); background: var(--blue);
  box-shadow: inset 0 0 0 1px var(--navy);
}
button:focus-visible {
  outline: 3px solid #345cc9; outline-offset: 2px;
}
button:disabled { opacity: .45; cursor: default; }
.swatch {
  display: block; width: 15px; height: 15px; border-radius: 50%;
  background: var(--ink); border: 1px solid #20242c44;
}
.slot { flex: 1; min-height: 0; min-width: 0; display: grid; place-items: center; padding: 10px; overflow: auto; }
.stage {
  position: relative; width: 100%; aspect-ratio: 16 / 9; overflow: hidden;
  background: #fff; border-radius: 12px; outline: 1px solid #ccd4e5;
  container-type: inline-size;
}
.sheet {
  position: absolute; inset: 0; display: flex; flex-direction: column;
  gap: 1.45cqw; padding: 2.3cqw 3.15cqw; font-size: 2.1cqw; line-height: 1.3;
}
.sheet[hidden] { display: none; }
.sheet h2 { color: var(--navy); font-size: 3.35cqw; line-height: 1.06; margin: 0; }
.prompt { margin: 0; background: var(--prompt); border-radius: .7cqw; padding: .83cqw 1.2cqw; }
.columns { display: grid; grid-template-columns: 61% 1fr; gap: 2cqw; min-height: 0; flex: 1; }
.columns.wide-figure { grid-template-columns: 65% 1fr; }
.figure { margin: 0; min-width: 0; min-height: 0; display: flex; align-items: flex-start; }
.figure img { width: 100%; height: 100%; object-fit: contain; object-position: top center; }
.figure.banner-figure { flex: 0 0 24cqw; justify-content: center; }
.figure.banner-figure img { width: 75%; }
.work { background: #f9fbff; border: .12cqw solid #c7d5ee; border-radius: .8cqw; display: flex; flex-direction: column; flex: 1; min-height: 0; padding: 1.15cqw; gap: .85cqw; }
.work h3 { margin: 0; color: var(--navy); font-size: 2.05cqw; }
.work p { margin: 0; }
.work .line { border-bottom: .12cqw solid #becce5; flex: 1; }
.split-work { display: grid; grid-template-columns: repeat(2,1fr); gap: 1.5cqw; flex: 1; min-height: 0; }
.equation { margin: 0; padding: 1cqw 1.3cqw; border-radius: .7cqw; background: var(--blue); font-weight: 600; }
table { width: 100%; border-collapse: collapse; text-align: left; color: var(--navy); }
th, td { padding: .57cqw 1.1cqw; border: .12cqw solid #c7d5ee; }
th { background: var(--blue); }
td { height: 4.1cqw; }
th[scope="row"] { width: 21%; background: #f7f9ff; }
sub, sup { line-height: 0; }
canvas { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: none; cursor: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAADRElEQVR4nK2WTWhcVRTH/+fkvo+YZmZaM0OlNoPSTCWUIenTVFOCiyJRMV0ISsGPVcduSi3Yus1SrYIoChJtl7ZSESRqowsVpWZsFo01QluN0YlQLRmTKZO8mfdxj4vMkyFJcWbq2bwLj//vd+95XM4DWiwR4bo1iQi1ytoIrgDA84IjYRi+Fwn/F4mIGDX4c1KrMAzHau/abkkS7dx13ZyIyMmT54Lnj7xVFRHx/VuUrIWffv/LIJV8XMc6H5MXj495qxK/NclG8C2JEZ3uPiCZnmclHhuR48fe8VuSrIOf/iqIdTysH3xoVEaefF22b3tCenY8I/HYiBx7YVUiIu9GefVfcCIKXNfN2bY9dubM1+Gh3AnODjjU6zggZuhQ41I+j2QyjlOnzinP84M33jx8MAxDY2Fh4fBNBTeF37ebsvfvge/5EK2RzmRAzLg6fRHMjJmZOVQqAWxb9adSKYtbhQMAiKC1xu2pJJaWluHc2xN8/sVryrbVVLGIISIqrhM0ChctMEwTy6UlfPbBR+jruysYH39JKUVTpVJpuKuLbogI8xp4W0NwERiWifLSIiY+/Bj9/XcHn3x6QhkGTxUKheFEIrEoIkxEmurgTES6Wq3mTNNchR98hbMDznq4uRGcpgqFwnA6nf4XDgBUCxERyfXfrt+RTCd/P3v2G3Uo96pkBxzudRwEftQWDcOyGoYDANc/k+nkYLG4rI4efVtv2tTO8c0JMDO01hBpHl4viFrlTE/P0XJ5Rex2GxfPf4e5K1dgWhaU0Xhb6iu6B3p0dJQB7JmYyIOICACUYeDHfB5tzNiS6moaDgCq1n8tIrFy2c3mJ2fQ0WGz1hrMDNMycfWHafy9WG4aHp2AAAiAzC8/X0vMzv4hnZ23URCEWFmpaM/zpVLxZWhoF8bHX24KHgnaAGgAg5OTl/nanwtetRpXtm1xX1+GHxjchX37HOzduxMALszPzz/SKDwSSG29e/bXv/jppx619u8fRG/vduy8Z9u8UuoygPMAJovFYr67u/tGo3AAiIZ1u+tWvi+V3OrWrZsvAfgWwE8AZohopT4Q3ZlG4PUhS0TupA3GQ22Yq1ZH4doA1X5Hog+vm97tmvoHSY6I65L/Dm4AAAAASUVORK5CYII=") 3 21, crosshair; }
canvas.eraser { cursor: cell; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; clip-path: inset(50%); overflow: hidden; white-space: nowrap; }
.app.expanded header, .app:fullscreen header { display: none; }
.app.expanded { position: fixed; inset: 0; z-index: 1; background: #edf0f7; }
@media (max-height: 465px) { header { padding-block: 6px; } header p { display: none; } }
@media (max-width: 520px) {
  header { padding-inline: 12px; }
  .toolbar, .navigation { padding-inline: 6px; gap: 4px 7px; }
  button { padding-inline: 8px; }
}

.theme-chemistry { --blue: #dcecff; --prompt: #fff0d3; --navy: #21205a; }
.theme-ks3 { --blue: #dce8ff; --prompt: #fff0bd; --navy: #21205a; }
.workspace { min-width: 0; }
.workspace .line { min-height: 2cqw; }
.plot-grid { flex: 1; min-height: 0; border: .12cqw solid #a5b7d8; border-radius: .7cqw;
  background: repeating-linear-gradient(to right, transparent 0 calc(5cqw - 1px), #dbe4f4 calc(5cqw - 1px) 5cqw),
              repeating-linear-gradient(to bottom, transparent 0 calc(5cqw - 1px), #dbe4f4 calc(5cqw - 1px) 5cqw), #fff; }
.plot-grid.centred { position: relative; }
.plot-grid.centred::after { content: ''; position: absolute; inset: 0 auto 0 50%; border-left: .14cqw dashed #7384a5; }
