/* The magic block at the top of the homepage (src/magic/section.mjs; scripts/build-magic.mjs joins this with the
   dashboard's own look into public/magic.css). A dark stage in both themes: the lesson's cards are Nock's glass cards. */
.magic-top{position:relative;padding:clamp(28px,5vw,72px) clamp(16px,4vw,48px) clamp(28px,4vw,64px);background:radial-gradient(120% 80% at 30% 0%,#17203a 0%,#0c0f16 60%,#090b10 100%);color:#eef2f8;overflow:hidden}
.magic-hero,.magic-tour{max-width:1240px;margin:0 auto;display:grid;gap:14px}
.magic-tour{margin-top:clamp(44px,7vw,96px)}
.magic-copy{max-width:720px}
.magic-copy h2{font-size:clamp(28px,4.4vw,54px);line-height:1.04;letter-spacing:-.02em;margin:4px 0 10px;color:#fff}
.magic-copy p{margin:0 0 6px;color:rgba(238,242,248,.78);font-size:clamp(15px,1.4vw,18px);line-height:1.5}
.magic-lesson-label{margin:0;font:600 16px/1.3 system-ui,sans-serif;color:#f7f7ff}
.magic-inline{min-width:0;width:100%;box-sizing:border-box;padding:clamp(14px,2.3vw,30px);border:1px solid #ffffff2b;border-radius:22px;background:radial-gradient(ellipse at 20% 0%,#26314b,#10141f 68%);color:#f7f7ff;text-align:left;box-shadow:0 22px 50px -26px #18152180}
.magic-inline .magic-hero{min-width:0;gap:10px}
.magic-inline .magic-stage{min-width:0}
.magic-inline .magic-cards{min-width:0;max-height:clamp(130px,22vw,310px);overflow:auto;justify-content:safe center}
.magic-inline .magic-card{flex:none}
.magic-inline .magic-caption{font-size:clamp(14px,1.2vw,18px);color:#b6bfcc}
.magic-inline .magic-transcript{width:100%;min-width:0}
.magic-inline .magic-transcript p{max-height:9em;overflow:auto;padding:0 8px}
.magic-inline .magic-button{min-height:42px;font:600 14px/1.25 system-ui,sans-serif}
.magic-guidance .magic-tour{margin-top:0}
.magic-stage{position:relative;display:grid;grid-template-columns:minmax(0,1.3fr) minmax(0,1fr);gap:clamp(12px,2vw,24px);align-items:center}
.magic-poster,.magic-canvas{grid-column:1;grid-row:1;width:100%;aspect-ratio:4/3;height:auto;object-fit:contain;display:block}
.magic-canvas[hidden]{display:block!important;visibility:hidden}
.magic-live .magic-canvas{visibility:visible}
.magic-live .magic-poster{visibility:hidden}
.magic-cards{grid-column:2;grid-row:1;display:flex;flex-direction:column;gap:12px;align-self:stretch;justify-content:center}
.magic-card{margin:0;position:relative;border-radius:16px;background:linear-gradient(180deg,rgba(15,59,143,.86),rgba(7,30,74,.92));border:1px solid rgba(127,227,255,.3);box-shadow:0 12px 28px -12px rgba(0,0,0,.55),0 2px 8px rgba(0,0,0,.25);padding:8px;aspect-ratio:var(--card-w,420)/var(--card-h,340);opacity:0;transform:translateY(10px);transition:opacity .45s ease,transform .45s ease}
.magic-card.shown{opacity:1;transform:none}
.magic-card img,.magic-card-svg{display:block;width:100%;height:100%}
.magic-caption{min-height:1.6em;margin:6px auto 0;max-width:62ch;text-align:center;font-size:clamp(16px,1.8vw,21px);line-height:1.45;color:rgba(238,242,248,.42)}
.magic-caption .said{color:#fff}
.magic-controls{display:flex;flex-wrap:wrap;gap:10px;justify-content:center}
.magic-button{height:44px;padding:0 22px;border-radius:22px;border:1px solid rgba(255,255,255,.28);background:#fff;color:#0c0f16;font:600 15px/1 inherit;cursor:pointer}
.magic-button:disabled{opacity:.6;cursor:progress}
.magic-quiet{background:transparent;color:#fff}
.magic-button:focus-visible{outline:3px solid #8fb7ff;outline-offset:2px}
.magic-transcript{max-width:70ch;margin:4px auto 0;color:rgba(238,242,248,.72);font-size:14px;line-height:1.55}
.magic-transcript summary{cursor:pointer;text-align:center}
.magic-window{position:relative;width:100%;aspect-ratio:var(--frame-w,1280)/var(--frame-h,800);border-radius:12px;overflow:hidden;box-shadow:0 30px 60px -30px rgba(0,0,0,.65);background:#eef1f5}
.magic-dash{position:absolute;left:0;top:0;width:calc(var(--frame-w,1280)*1px);height:calc(var(--frame-h,800)*1px);transform-origin:0 0;transform:scale(var(--dash-scale,1))}
.magic-window .magic-dash{width:1280px;height:800px}
.magic-marks{position:absolute;inset:0;width:100%;height:100%;pointer-events:none;overflow:visible}
.magic-mark rect,.magic-mark circle,.magic-mark ellipse,.magic-mark path{fill:none;stroke:var(--mark-ink,#38c8ff);stroke-width:3;stroke-dasharray:1 1;stroke-linecap:round;stroke-linejoin:round;filter:drop-shadow(0 0 6px var(--mark-glow,rgba(56,200,255,.55)))}
.magic-mark .magic-pill rect{fill:var(--mark-ink,#38c8ff);stroke:none;stroke-dasharray:none;filter:drop-shadow(0 4px 10px rgba(0,0,0,.25))}
.magic-mark .magic-pill text{fill:#06121c;font:600 12px/1 -apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,sans-serif}
.magic-arrow-head{fill:var(--mark-ink,#38c8ff)}
.magic-tour-cards{position:absolute;inset:0;pointer-events:none}
.magic-tour-card{position:absolute}
@media (max-width:720px){
  .magic-stage{grid-template-columns:1fr}
  .magic-cards{grid-column:1;grid-row:2;flex-direction:row;overflow-x:auto;scroll-snap-type:x mandatory;padding-bottom:6px}
  .magic-cards .magic-card{flex:0 0 78%;scroll-snap-align:center}
  .magic-inline .magic-hero{gap:8px}
  .magic-inline .magic-cards{max-height:110px;justify-content:flex-start}
  .magic-inline .magic-cards .magic-card{height:96px;width:auto;flex:0 0 auto}
  .magic-inline .magic-poster,.magic-inline .magic-canvas{max-height:180px}
}
@media (prefers-reduced-motion:reduce){.magic-card{transition:none;transform:none}}

/* The saved watch and Nock's own sheet share a desktop-sized stage. */
.magic-inline:has(.watch-lesson) {
  padding: 0;
  border-radius: 22px;
  border: 1px solid var(--nc-line);
  background: var(--nc-bg);
  color: var(--nc-ink);
  box-shadow: 0 20px 60px -36px var(--nc-shadow);
}
.magic-inline .watch-lesson { gap: 0; }
.watch-prompt {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: clamp(12px, 1.5vw, 20px);
  background: linear-gradient(125deg, var(--nc-bg), color-mix(in srgb, var(--nc-bg) 88%, var(--nc-accent)));
  border-radius: 21px 21px 0 0;
}
.watch-prompt img { width: 28px; height: 28px; object-fit: contain; }
.watch-prompt h2 {
  margin: 0;
  font-family: inherit;
  font-size: clamp(15px, 1.25vw, 20px);
  line-height: 1.35;
  font-weight: 550;
  letter-spacing: -.025em;
  color: var(--nc-ink);
}
.magic-inline .watch-stage {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr);
  gap: 0;
  align-items: center;
  min-height: 0;
  padding: 0 clamp(12px, 1.8vw, 28px) 0 0;
  isolation: isolate;
  background:
    radial-gradient(ellipse at 32% 68%, #46423a 0, transparent 47%),
    linear-gradient(145deg, #27282a 5%, #202225 65%, #17181b);
}
.watch-model { position: relative; min-width: 0; }
.watch-model .magic-poster,.watch-model .magic-canvas {
  width: 100%; max-height: none; aspect-ratio: 1.13; height: auto;
  object-fit: contain;
}
.watch-model .magic-canvas {
  position: absolute; inset: 0;
  height: 100%;
  cursor: grab;
}
.watch-model .magic-canvas:active { cursor: grabbing; }
.watch-model .magic-canvas:focus-visible { outline: 2px solid #d3c2ed; outline-offset: -4px; }
.watch-load {
  position: absolute; bottom: 6%; left: 50%; transform: translateX(-50%);
  min-height: 42px; white-space: nowrap; border: 1px solid #aaaab5;
  border-radius: 8px; padding: 0 16px; background: #eeedf5; color: #24212b; font-size: 14px;
}
.watch-load[hidden] { display: none; }
.watch-drawing {
  min-width: 0;
  display: grid;
  align-self: center;
  gap: 8px;
  margin-top: 24px;
  text-align: right;
  color: #ededf1;
}
.watch-drawing img {
  display: block; width: 100%; height: auto;
  border-radius: 7px;
  box-shadow: 0 12px 25px -10px #000b;
}
.watch-drawing > span { color: #dddad6; font-size: 12px; line-height: 1.3; }
.watch-drawing:hover > span { text-decoration: underline; }
.watch-notes { min-width: 0; }
.watch-notes summary { cursor: pointer; }
.watch-notes ol { padding-left: 1.3em; line-height: 1.5; }
.watch-notes li + li { margin-top: .35em; }
.watch-status:empty { display: none; }
.watch-status { color: var(--nc-muted); margin: 8px 15px; font-size: 13px; }
@media (max-width: 580px) {
  .watch-prompt { padding: 11px 13px; gap: 8px; }
  .watch-prompt img { width: 23px; height: 23px; }
  .magic-inline .watch-stage { grid-template-columns: minmax(0, 1.62fr) minmax(0, 1fr); padding-right: 10px; }
  .watch-model .magic-poster,.watch-model .magic-canvas { aspect-ratio: .78; }
  .watch-drawing { margin-top: 10px; gap: 6px; }
  .watch-drawing > span { font-size: 10px; }
}


.watch-step {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px clamp(14px, 1.6vw, 25px);
  background: #202124; color: #f6f5f2;
  border-top: 1px solid #ffffff1c;
}
.watch-step-copy { min-width: 0; }
.watch-step-copy strong { display: block; font: 600 11px/1.5 ui-monospace, monospace; color: #e3c999; }
.watch-step-copy p { margin: 3px 0 0; font-size: clamp(13px, 1.08vw, 16px); line-height: 1.42; color: #f5f3f0; }
.watch-paging { display: flex; align-items: center; gap: 3px; flex: none; }
.watch-paging span { color: #d9d5cd; font: 11px/1.2 ui-monospace, monospace; white-space: nowrap; }
.watch-paging button {
  width: 34px; height: 40px; padding: 0; border: 0;
  background: transparent; color: #f4f3f0; font: 24px/1.2 system-ui,sans-serif;
}
.watch-paging button:focus-visible,.watch-load:focus-visible { outline-color: #e6c68d; }
.watch-paging button:disabled { color: #666670; }
@media (max-width: 580px) {
  .watch-step { gap: 4px; padding: 8px 10px; }
  .watch-step-copy p { min-height: 2.8em; font-size: 12px; }
  .watch-paging { gap: 0; }
  .watch-paging button { width: 28px; }
}

/* The model sits directly over the homepage. Only the saved sheet gets a paper frame. */
.magic-inline:has(.lesson-choice) {
  border: 0; border-radius: 0; background: transparent; box-shadow: none; padding: 0;
  color: var(--nc-ink);
}
.lesson-choice [role="tabpanel"][hidden] { display: none !important; }
.lesson-choice { position: relative; isolation: isolate; }
.lesson-choice::before {
  position: absolute; z-index: -1; inset: -10px -2% -20px; content: ""; pointer-events: none;
  background: radial-gradient(ellipse at 48% 58%, color-mix(in srgb, var(--nc-bg) 67%, transparent) 15%, color-mix(in srgb, var(--nc-bg) 36%, transparent) 42%, transparent 73%);
}
.lesson-tabs {
  display: flex; gap: 20px; align-items: center; width: fit-content;
  margin: 0 0 14px auto; border-bottom: 1px solid var(--nc-line);
}
.lesson-tabs button {
  appearance: none; background: transparent; padding: 6px 1px 8px; min-height: 36px;
  border: 0; border-bottom: 2px solid transparent; margin-bottom: -1px; color: var(--nc-muted);
  font: inherit; font-weight: 550; font-size: 14px; line-height: 1.2; cursor: pointer;
}
.lesson-tabs button[aria-selected="true"] { color: var(--nc-ink); border-bottom-color: currentColor; font-weight: 650; }
.lesson-tabs button:focus-visible,.tank-tools button:focus-visible,.tank-sheet:focus-visible {
  outline: 2px solid var(--nc-ink); outline-offset: 4px;
}
.lesson-choice .watch-lesson { border: 1px solid var(--nc-line); border-radius: 22px; background: var(--nc-bg); }
.tank-lesson { text-align: left; }
.tank-prompt {
  display: flex; gap: 10px; align-items: center; color: var(--nc-ink);
}
.tank-prompt img { width: 26px; height: 26px; flex: none; object-fit: contain; }
.tank-prompt h2 { margin: 0; font-family: inherit; font-size: clamp(18px, 1.65vw, 25px); line-height: 1.18; font-weight: 570; letter-spacing: -.035em; }
.tank-space { position: relative; width: 100%; aspect-ratio: 1.75; isolation: isolate; }
.tank-model.magic-stage {
  position: absolute; inset: 23% 14% -3% -4%; display: block; min-width: 0; min-height: 0;
  background: transparent;
}
.tank-model .magic-canvas,.tank-model .magic-poster {
  position: absolute; inset: 0; width: 100%; height: 100%; max-height: none; aspect-ratio: auto;
  object-fit: contain; touch-action: pan-y pinch-zoom;
}
.tank-model .magic-poster { pointer-events: none; }
.tank-model .magic-canvas { cursor: grab; filter: drop-shadow(0 15px 10px #1c1a201c); }
.tank-model .magic-canvas:active { cursor: grabbing; }
.tank-model .magic-canvas:focus-visible { outline: 2px dashed var(--nc-muted); outline-offset: -5px; border-radius: 12px; }
.tank-model .watch-load { z-index: 1; bottom: 2%; padding: 0 13px; }
.tank-sheet {
  position: absolute; top: -1%; right: 0; width: 31%; max-width: 260px; z-index: 1; display: block;
  background: #fff; border: 1px solid #241c192a; overflow: hidden; border-radius: 12px;
  box-shadow: 0 16px 34px -20px #29202677, 0 3px 8px #30281812;
}
.tank-sheet img { display: block; width: 100%; height: auto; }
.tank-sheet [data-tank-paper] { position: absolute; inset: 0; visibility: hidden; pointer-events: none; background: white; }
.tank-lesson[data-drawing-phase="model"] [data-paper-pen] { visibility: hidden; }
.tank-sheet span {
  position: absolute; top: 5px; right: 8px; font: 16px/1.2 system-ui,sans-serif; color: #626065;
}
.tank-sheet:hover span { color: #141219; }
.tank-reading {
  width: min(100%, 53ch); margin: 8px 0 13px; min-height: 2.8em;
  font-size: clamp(15px, 1.25vw, 19px); line-height: 1.4; color: var(--nc-ink);
}
.tank-lesson[data-cutaway="false"] .tank-cut-line,.tank-lesson[data-cutaway="true"] .tank-whole-line { display: none; }
.tank-tools {
  display: flex; align-items: center; gap: 8px; width: fit-content; max-width: 100%;
  padding: 5px 12px 5px 5px; border: 1px solid #505056;
  border-radius: 16px; color: #f5f3ef; background: linear-gradient(#303035,#202024);
  box-shadow: inset 0 1px 0 #ffffff26, 0 6px 20px -12px #15152088;
}
.tank-tools button {
  display: inline-flex; gap: 7px; align-items: center; justify-content: center;
  min-height: 36px; padding: 0 12px; font: inherit; font-size: 13px; font-weight: 550;
  background: transparent; color: #e9e8eb; border: 1px solid transparent; border-radius: 10px; cursor: pointer;
}
.tank-tools .tank-cut { border-color: #656268; background: #3f3e45; color: #fff; }
.tank-tools .tank-cut[aria-pressed="true"] { background: #eddfb8; border-color: #e6d2a2; color: #31291b; }
.tank-tools .tank-reset:hover,.tank-tools [data-tank-replay]:hover { background: #414048; }
.tank-tools button:disabled { opacity: .52; cursor: default; }
.tank-tools button:focus-visible { outline-color: #efd396; outline-offset: 1px; }
.tank-tools button span { font-size: 17px; line-height: 1; }
.tank-orbit-hint { color: #ccc9d0; font-size: 12px; border-left: 1px solid #68666e; padding-left: 13px; }
.tank-status { margin: 8px 0; color: var(--nc-muted); font-size: 13px; }
.tank-status:empty { display: none; }
@media (max-width: 800px) {
  .lesson-tabs { margin-bottom: 8px; }
  .tank-space { aspect-ratio: 1.53; }
  .tank-sheet { top: 3%; width: 33%; border-radius: 9px; }
  .tank-lesson:is([data-narration="playing"],[data-narration="paused"]) .tank-sheet { width: 42%; }
  .tank-model.magic-stage { inset: 27% 8% -1% -3%; }
  .tank-reading { min-height: 0; }
  .tank-model .watch-load { min-height: 34px; font-size: 12px; }
}
@media (max-width: 420px) {
  .tank-tools { gap: 2px; padding-right: 8px; }
  .tank-tools button { min-height: 38px; padding-inline: 8px; }
  .tank-orbit-hint { display: none; }
}

/* The two lessons share one open work surface and one physical-looking play control. */
.lesson-choice .lesson-prompt-row {
  display: flex; align-items: center; justify-content: space-between; gap: 18px;
  margin: 0 0 clamp(12px, 1.5vw, 22px);
}
.lesson-prompt-row h2 {
  margin: 0; max-width: 26ch; text-wrap: balance;
  color: var(--nc-ink); font: inherit; font-weight: 575; line-height: 1.13;
  font-size: clamp(20px, 2.1vw, 33px); letter-spacing: -.045em;
}
.lesson-try {
  position: relative; isolation: isolate; overflow: hidden; flex: none;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 46px; padding: 0 15px 0 10px;
  color: #f7fff9; font: inherit; font-weight: 640; font-size: 15px;
  border: 1px solid #27292d; border-radius: 15px;
  background: linear-gradient(172deg, #53575b -18%, #24282b 38%, #141719 72%, #2e3337);
  box-shadow: inset 0 1px 0 #ffffff75, inset 0 -2px 4px #ffffff18, 0 5px 10px -5px #101b2288;
  cursor: pointer; transition: transform .18s ease, box-shadow .24s ease;
}
.lesson-try img { width: 25px; height: 25px; object-fit: contain; }
.lesson-try i { width: 7px; height: 7px; margin-left: 3px; background: #95efb7; border-radius: 50%; box-shadow: 0 0 6px #9efabc60; }
.lesson-try::after {
  position: absolute; bottom: 0; left: 8%; width: 84%; height: 2px; content: ''; opacity: 0;
  background: linear-gradient(90deg, transparent, #adf5c3 35%, #e8fff1 98%, transparent);
  transform: scaleX(var(--lesson-progress, 0)); transform-origin: left;
}
.lesson-choice [data-trying="true"] .lesson-try::after { opacity: 1; }
.lesson-try:hover { transform: translateY(-1px); box-shadow: inset 0 1px 0 #ffffff80, 0 8px 18px -7px #15221d80; }
.lesson-try:active { transform: translateY(1px); }
.lesson-try:focus-visible { outline: 3px solid var(--nc-ink); outline-offset: 4px; }
.lesson-try:disabled { opacity: .72; cursor: default; }
.lesson-choice::before { transition: opacity .45s ease; }
.lesson-choice .tank-space::before {
  content: ''; z-index: -1; pointer-events: none; position: absolute; inset: 0 -2%;
  background: radial-gradient(ellipse at 37% 65%, #a4ccb82e, transparent 59%);
  opacity: 0; transition: opacity .5s ease;
}
.lesson-choice [data-trying="true"] .tank-space::before { opacity: 1; }
.lesson-travel-pen { position: absolute; left: 0; top: 0; z-index: 3; width: 40px; height: 40px; pointer-events: none; }
.lesson-travel-pen[hidden] { display: none; }
.tank-lesson[data-drawing-phase="handoff"] [data-paper-pen] { visibility: hidden; }
.tank-sheet { transition: box-shadow .3s ease; }
.tank-lesson:is([data-drawing-phase="handoff"],[data-drawing-phase="paper"]) .tank-sheet {
  box-shadow: 0 15px 36px -18px #1f342f70, 0 0 0 2px #81c7a788;
}
.lesson-choice .tank-lesson:has(.lesson-try:enabled) .watch-load { display: none; }
.tank-layers { display: inline-flex; align-items: center; font-size: 13px; gap: 8px; }
.tank-layers input { width: clamp(54px, 6vw, 90px); margin: 0; height: 34px; accent-color: #e6d2a2; cursor: pointer; }
@media (max-width: 800px) {
  .lesson-prompt-row h2 { font-size: 19px; }
  .lesson-choice .lesson-prompt-row { margin-bottom: 12px; gap: 9px; }
  .lesson-try { height: 39px; gap: 5px; padding: 0 10px 0 6px; font-size: 13px; border-radius: 12px; }
  .lesson-try img { width: 22px; height: 22px; }
}
@media (max-width: 550px) {
  .tank-lesson .tank-tools { gap: 4px; padding-inline: 4px; }
  .tank-layers { font-size: 12px; gap: 5px; }
  .tank-layers input { width: 55px; }
  .tank-lesson .tank-orbit-hint { display: none; }
}
@media (max-width: 359px) {
  .tank-lesson .tank-tools button { padding: 0 6px; }
  .tank-lesson .tank-reset span { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .lesson-try,.tank-sheet,.lesson-choice::before,.lesson-choice .tank-space::before { transition: none; }
  /* The static opening must start at the top even when the lesson is taller than the phone. */
  .nc-hero .nc-pin:has(.lesson-choice) { top: 0; }
}
.lesson-choice button,.lesson-choice input { scroll-margin-block: 100px 40px; }
@media (min-width: 1050px) and (prefers-reduced-motion: no-preference) {
  .nc-first:has(.lesson-choice) .teaching-intro {
    transform-origin: left center; transition: opacity .45s ease, transform .55s ease;
  }
  .nc-first:has([role="tabpanel"]:not([hidden]) [data-demonstrating="true"][data-trying="true"]) .teaching-intro {
    opacity: .76; transform: translateX(-4px) scale(.98);
  }
}

/* Nock's desktop lesson bar, using the glass and warm-metal stops from BAR_LOOK. */
:is(.tank-lesson, .watch-lesson) .tank-tools {
  position: relative; isolation: isolate; box-sizing: border-box;
  display: inline-flex; vertical-align: middle; align-items: center; gap: 5px;
  padding: 5px 6px; min-height: 52px; border: 1px solid rgb(255 255 255 / .15); border-radius: 26px;
  color: #f0f1f3; font: 600 13px/1 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: linear-gradient(0deg, rgb(255 255 255 / .15), transparent 18px),
    linear-gradient(180deg, rgb(255 255 255 / .05), transparent 45%), rgb(21 22 25 / .76);
  -webkit-backdrop-filter: blur(16px) saturate(1.15);
  backdrop-filter: blur(16px) saturate(1.15);
  box-shadow: inset 0 1px 0 #ffffff61, inset 0 -1px 0 #000e, inset 0 -11px 16px #0004, 0 9px 20px -9px #10101866;
}
:is(.tank-lesson, .watch-lesson) .tank-tools::after {
  content: ""; position: absolute; inset: -1px; padding: 1px; border-radius: inherit; pointer-events: none;
  background: linear-gradient(112deg, #ffffff99, #66beff4d 24%, #ffffff14 45%, #d684ff47 70%, #ffe4ae70);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
}
:is(.tank-lesson, .watch-lesson) .tank-tools :is(button,summary) {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; box-sizing: border-box;
  padding: 0 13px; min-height: 38px; border: 0; border-radius: 999px; color: inherit;
  font: inherit; letter-spacing: .005em; white-space: nowrap; cursor: pointer;
}
:is(.tank-lesson, .watch-lesson) .tank-tools :is(button,summary) svg { width: 15px; height: 15px; flex: none; }
:is(.tank-lesson, .watch-lesson) .tank-tools :is(.tank-cut,summary,.tank-reset) {
  background: linear-gradient(rgb(255 255 255 / .09), rgb(255 255 255 / .03));
  box-shadow: inset 0 1px 0 #ffffff33, inset 0 0 0 1px #ffffff16;
}
:is(.tank-lesson, .watch-lesson) .tank-tools .tank-cut[aria-pressed=true], :is(.tank-lesson, .watch-lesson) .tank-more[open] summary {
  background: linear-gradient(rgb(255 255 255 / .24), rgb(255 255 255 / .1));
  box-shadow: inset 0 1px 0 #ffffff75, inset 0 0 0 1px #ffffff46;
}
:is(.tank-lesson, .watch-lesson) .tank-tools :is(button,summary):focus-visible, .tank-more-panel input:focus-visible {
  outline: 2px solid #fff; outline-offset: 2px;
}
:is(.tank-lesson, .watch-lesson) .tank-tools :is(button,summary):active:not(:disabled) { filter: brightness(.87); }
:is(.tank-lesson, .watch-lesson) .tank-tools button:disabled { opacity: .5; cursor: default; }
:is(.tank-lesson, .watch-lesson) .tank-more summary { width: 38px; padding-inline: 0; list-style: none; }
.tank-more summary::marker { content: ""; }
.tank-more summary::-webkit-details-marker { display: none; }
.tank-view-switch {
  display: inline-flex; align-items: center; border-radius: 999px; padding: 1px;
  background: rgb(0 0 0 / .15); box-shadow: inset 0 0 0 1px rgb(255 255 255 / .12);
}
:is(.tank-lesson, .watch-lesson) .tank-view-switch button { padding-inline: 14px; }
:is(.tank-lesson, .watch-lesson) .tank-view-switch [aria-pressed=true] {
  color: #1b1407; background: linear-gradient(#f0d7a4, #cfa96a 48%, #b58c4c 52%, #c9a262);
  box-shadow: inset 0 1px 0 #ffffffb3, inset 0 -1px 0 #50320a80, 0 2px 6px #0005;
}
.tank-more-panel {
  position: absolute; z-index: 2; left: 4px; bottom: calc(100% + 8px); box-sizing: border-box;
  display: grid; gap: 6px; width: min(210px, 100%); padding: 8px;
  border: 1px solid #ffffff36; border-radius: 16px; color: #f0f1f3;
  background: linear-gradient(135deg, #ffffff18, transparent 54%), rgb(21 22 25 / .88);
  -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
  box-shadow: inset 0 1px 0 #ffffff4d, 0 9px 20px -8px #10101866;
}
.tank-more-panel .tank-layers { display: flex; justify-content: space-between; gap: 12px; padding-inline: 7px; }
.tank-more-panel .tank-layers input { flex: 1; width: 0; min-width: 44px; margin: 0; accent-color: #e6ca8d; }
.tank-more-panel .tank-reset { width: 100%; }
@media (hover: hover) {
  :is(.tank-lesson, .watch-lesson) .tank-tools :is(button,summary):hover:not(:disabled,[aria-pressed=true]) { background-color: #ffffff1f; }
  :is(.tank-lesson, .watch-lesson) .tank-view-switch [aria-pressed=true]:hover { filter: brightness(1.08); }
}
@media (max-width: 580px) {
  :is(.tank-lesson, .watch-lesson) .tank-tools { gap: 4px; padding: 4px; }
  :is(.tank-lesson, .watch-lesson) .tank-tools :is(button,summary) { min-height: 44px; padding-inline: 10px; }
  :is(.tank-lesson, .watch-lesson) .tank-more summary { width: 44px; padding: 0; }
  /* Leave the lesson buttons and the branded chat launcher separate as a visitor scrolls. */
  html[data-tank-tools-near-chat] .site-chat-launcher {
    width: 48px; min-height: 48px; padding: 5px; justify-content: center; gap: 0; border-radius: 50%;
  }
  html[data-tank-tools-near-chat] .site-chat-launcher > span { display: none; }
}
@media (max-width: 410px) {
  :is(.tank-lesson, .watch-lesson) .tank-cut svg, :is(.tank-lesson, .watch-lesson) .tank-view-switch button:last-child svg { display: none; }
}
@media (max-width: 370px) {
  :is(.tank-lesson, .watch-lesson) .tank-tools { gap: 2px; padding-inline: 3px; font-size: 12px; }
  :is(.tank-lesson, .watch-lesson) .tank-tools :is(button,summary) { padding-inline: 4px; }
  :is(.tank-lesson, .watch-lesson) .tank-view-switch svg { display: none; }
  :is(.tank-lesson, .watch-lesson) .tank-view-switch button { min-width: 44px; }
}
@media (forced-colors: active) {
  :is(.tank-lesson, .watch-lesson) .tank-tools, .tank-more-panel, .tank-view-switch { border: 1px solid ButtonText; }
  :is(.tank-lesson, .watch-lesson) .tank-tools [aria-pressed=true] { outline: 2px solid Highlight; outline-offset: -2px; }
}

/* In the lesson chooser the page itself is the stage. The tall watch needs more
   headroom than the tank, and the original paper keeps its own desktop corner. */
.lesson-choice .watch-lesson {
  display: block;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  color: var(--nc-ink);
}
.lesson-choice .watch-stage {
  display: block;
  position: relative;
  isolation: isolate;
  width: 100%;
  aspect-ratio: 1.75;
  padding: 0;
  background: transparent;
}
.lesson-choice .watch-model {
  position: absolute;
  inset: 0 27% 0 -3%;
}
.lesson-choice .watch-model .magic-canvas,
.lesson-choice .watch-model .magic-poster {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  max-height: none;
  aspect-ratio: auto;
  object-fit: contain;
}
.lesson-choice .watch-model .magic-canvas { filter: drop-shadow(0 12px 8px #1c1a201a); }
.lesson-choice .watch-model .magic-canvas:focus-visible {
  outline: 2px dashed var(--nc-muted);
  outline-offset: -5px;
  border-radius: 12px;
}
.lesson-choice .watch-model .watch-load { bottom: 0; min-height: 36px; }
.lesson-choice .watch-drawing {
  display: block;
  margin: 0;
  line-height: 0;
}
.lesson-choice .watch-drawing img { border-radius: 0; box-shadow: none; }
.lesson-choice .watch-drawing > span { color: #626065; line-height: 1.2; }
.lesson-choice .watch-step {
  align-items: center;
  justify-content: space-between;
  width: min(100%, 63ch);
  margin: 10px 0 13px;
  padding: 0;
  border: 0;
  color: var(--nc-ink);
  background: transparent;
}
.lesson-choice .watch-step-copy strong { color: var(--nc-muted); }
.lesson-choice .watch-step-copy p {
  margin: 2px 0 0;
  color: var(--nc-ink);
  font-size: clamp(15px, 1.25vw, 19px);
  line-height: 1.4;
}
.lesson-choice .watch-paging button { color: var(--nc-ink); }
.lesson-choice .watch-paging button:disabled { color: var(--nc-muted); opacity: .5; }
.lesson-choice .watch-paging span { color: var(--nc-muted); }
.lesson-choice .watch-status { margin: 8px 0; }
.watch-lesson[data-watch-state="unavailable"] [data-model-toolbar] { display: none; }
@media (max-width: 800px) {
  .lesson-choice .watch-stage { aspect-ratio: 1.53; }
  .lesson-choice .watch-model { inset: 1% 29% 0 -3%; }
  .lesson-choice .watch-step-copy p { min-height: 0; }
}
@media (max-width: 580px) {
  .lesson-choice .watch-step { gap: 3px; }
}

.teaching-heading { display: grid; justify-items: start; }
.site-tour-start {
  appearance: none; pointer-events: auto; margin-top: 18px;
}
.site-tour-start[hidden], .site-tour[hidden] { display: none; }
.site-tour {
  position: fixed; inset: 0; z-index: 1001; pointer-events: none;
  font-family: Inter, -apple-system, sans-serif;
}
.site-tour-ink { position: absolute; inset: 0; width: 100%; height: 100%; overflow: hidden; }
.site-tour-ink path {
  fill: none; stroke: #3cf59b; stroke-width: 2.75; stroke-linecap: round; stroke-linejoin: round;
  filter: drop-shadow(0 0 1.2px #04331f) drop-shadow(0 0 4px #3cf59b75);
}
.site-tour-note {
  --tour-glass: rgb(244 248 247 / .34);
  --tour-reflection: rgb(255 255 255 / .52);
  --tour-rim: rgb(255 255 255 / .89);
  --tour-edge: rgb(30 55 59 / .28);
  --tour-ink: #172a29;
  --tour-button: #304b49;
  position: absolute; left: 0; top: 0; pointer-events: auto; box-sizing: border-box;
  width: min(348px, calc(100% - 32px)); padding: 12px 13px 12px 22px;
  display: flex; align-items: center; gap: 10px;
  color: var(--tour-ink); border-radius: 999px; border: 1px solid var(--tour-rim);
  background: linear-gradient(155deg, var(--tour-reflection), transparent 43%) border-box, var(--tour-glass);
  -webkit-backdrop-filter: blur(10px) saturate(1.23);
  backdrop-filter: blur(10px) saturate(1.23);
  box-shadow: 0 0 0 1px var(--tour-edge), inset 0 1px 2px rgb(255 255 255 / .62),
    inset 0 -1px 2px rgb(118 157 157 / .42), 0 6px 18px -9px rgb(16 43 50 / .4);
}
[data-theme=dark] .site-tour-note {
  --tour-glass: rgb(20 29 34 / .42); --tour-reflection: rgb(191 225 229 / .15);
  --tour-rim: rgb(208 233 233 / .49); --tour-edge: rgb(8 16 19 / .68);
  --tour-ink: #f3faf7; --tour-button: #d5e6e2;
}
.site-tour-note p {
  flex: 1 1 auto; margin: 0; color: var(--tour-ink);
  font: 540 14px/1.37 Inter, -apple-system, sans-serif; letter-spacing: -.014em; text-wrap: pretty;
}
.site-tour-controls { display: flex; flex-shrink: 0; align-items: center; }
.site-tour-note button {
  display: grid; place-items: center; appearance: none; color: var(--tour-button); background: transparent;
  border: 0; border-radius: 50%; width: 30px; height: 32px; padding: 5px; cursor: pointer;
}
.site-tour-note button svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.65; stroke-linecap: round; stroke-linejoin: round; }
.site-tour-note button:focus-visible { outline: 2px solid currentColor; outline-offset: 1px; }
.site-tour-note button:hover { background: color-mix(in srgb, currentColor 10%, transparent); }
@media (pointer: coarse) { .site-tour-note button { width: 35px; height: 36px; } }
@media (prefers-reduced-transparency: reduce) {
  .site-tour-note { background: #f1f5f4; }
  [data-theme=dark] .site-tour-note { background: #202b30; }
}
@media (forced-colors: active) { .site-tour-note { background: Canvas; color: CanvasText; border-color: CanvasText; } }
@media (min-width: 386px) and (max-width: 800px) {
  .teaching-heading { grid-template-columns: 1fr; }
  .teaching-heading > h1, .teaching-heading > .site-tour-start { grid-area: 1 / 1; }
  .teaching-heading > .site-tour-start { justify-self: end; align-self: end; margin: 0 0 1px; }
}
@media (max-width: 385px) {
  .teaching-heading > .site-tour-start { margin-top: 12px; }
}

@font-face {
  font-family: NockTracksHand;
  src: url('/assets/magic/tank/tracks/ArchitectsDaughter-Regular.ttf') format('truetype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
.tank-lesson [data-tracks-open] {
  display: block; width: fit-content; max-width: 100%; min-height: 40px;
  margin: 2px 0 0; padding: 6px 0; border: 0; background: transparent; color: var(--nc-ink);
  font: inherit; font-size: 14px; text-align: left; cursor: pointer;
  text-decoration: underline; text-underline-offset: 4px; text-decoration-color: currentColor;
}
.tank-lesson [data-tracks-open]:focus-visible, .tracks-head button:focus-visible {
  outline: 2px solid currentColor; outline-offset: 3px; border-radius: 4px;
}
.tank-lesson .tracks-card {
  position: absolute; z-index: 5; top: 50%; left: 50%; transform: translate(-50%,-50%);
  box-sizing: border-box; width: min(94%, 500px); margin: 0; padding: 12px;
  background: #11213b; color: #f5f9ff; border: 1px solid #a9c6ee; border-radius: 16px;
  box-shadow: 0 20px 45px -15px #091321aa, inset 0 1px 0 #dcecff26;
}
.tracks-card .tracks-head {
  position: static; display: flex; align-items: center; justify-content: space-between;
  gap: 8px; margin: 0 0 8px; padding: 0; min-height: 32px;
}
.tracks-head h3 {
  margin: 0; color: #f5f9ff; font: 600 clamp(17px,1.5vw,23px)/1.18 system-ui,sans-serif;
  letter-spacing: -.035em;
}
.tracks-head button {
  display: grid; place-items: center; width: 36px; height: 36px; padding: 0; border: 1px solid #70829b;
  border-radius: 9px; background: #213552; color: #fff; font: 24px/1 system-ui,sans-serif; cursor: pointer;
}
.tracks-card .tracks-figure { position: relative; overflow: hidden; border-radius: 7px; background: #0b2d6d; }
.tracks-figure > img { display: block; width: 100%; height: auto; }
.tracks-figure .tracks-ink { position: absolute; inset: 0; visibility: hidden; pointer-events: none; }
.tracks-card[data-phase="loading"] .tracks-figure > img { opacity: 0; }
.tracks-card .tracks-caption {
  min-height: 2.7em; margin: 10px 1px 0; color: #e5eefb; font: inherit;
  font-size: clamp(14px,1.06vw,16px); line-height: 1.38;
}
@media (max-width: 550px) {
  .tank-lesson .tracks-card { width: 100%; border-radius: 13px; padding: 10px; }
  .tracks-head button { min-height: 42px; min-width: 42px; }
  .tracks-card .tracks-caption { min-height: 3.8em; }
}

.tank-followups {
  display: flex; align-items: baseline; flex-wrap: wrap; column-gap: 20px;
  margin-top: 4px;
}
.tank-followups [hidden] { display: none; }
.tank-followups a {
  display: inline-flex; align-items: center; min-height: 40px;
  color: var(--nc-muted); font: inherit; font-size: 14px; text-underline-offset: 4px;
}
.tank-media-viewer {
  box-sizing: border-box; width: min(900px, calc(100% - 24px));
  max-height: calc(100dvh - 24px); padding: 0; margin: auto; overflow: auto;
  border: 1px solid #ffffff50; border-radius: 19px; color: #fff;
  background: linear-gradient(145deg, #303438d9, #12161be3);
  -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px);
  box-shadow: inset 0 1px 1px #ffffff4a, 0 12px 60px #0006;
}
.tank-media-viewer::backdrop { background: #0c12219c; }
.tank-media-viewer form {
  display: flex; align-items: center; justify-content: space-between; margin: 0;
  padding: 4px 8px 4px 16px;
}
.tank-media-viewer h2 { margin: 0; color: inherit; font: 600 15px/1.3 system-ui,sans-serif; }
.tank-media-viewer button {
  width: 44px; height: 44px; border: 0; border-radius: 50%; font-size: 24px;
  color: #fff; background: transparent; cursor: pointer;
}
.tank-media-viewer :focus-visible { outline: 2px solid #9feac4; outline-offset: -4px; }
.tank-media-content img, .tank-media-content video {
  display: block; width: 100%; height: auto; max-height: calc(100dvh - 80px);
  object-fit: contain;
}
.tank-media-content img { background: #fafafa; }
.tank-media-content video { background: #101114; }

/* The dashboard (src/magic/dashboard.mjs) */
.mdash{position:relative;width:1280px;height:800px;display:grid;grid-template-columns:184px 1fr;grid-template-rows:52px 1fr 30px;background:#eef1f5;color:#1f2933;font:12px/1.3 -apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Helvetica,Arial,sans-serif;border:1px solid #c9d1db;border-radius:10px;overflow:hidden;text-align:left;box-sizing:border-box}
.mdash *{box-sizing:border-box}
.md-top{grid-column:1/3;display:flex;align-items:center;gap:6px;padding:0 10px;background:#24324a;color:#e9eef5}
.md-logo{font-weight:700;font-size:14px;margin-right:6px;white-space:nowrap}
.md-search{flex:1;min-width:120px;height:30px;border-radius:6px;border:1px solid #3f5170;background:#1b263a;color:#e9eef5;padding:0 10px;font:inherit}
.md-btn{height:28px;padding:0 9px;border-radius:6px;border:1px solid #b9c3cf;background:#fff;color:#1f2933;font:inherit;white-space:nowrap;cursor:pointer}
.md-top .md-btn{background:#33445f;border-color:#4b5f80;color:#e9eef5}
.md-top .md-primary,.md-primary{background:#2f7de1;border-color:#2f7de1;color:#fff}
.md-icon{width:28px;padding:0;text-align:center}
.md-avatar{border-radius:50%;width:30px;padding:0;font-weight:700}
.md-nav{grid-row:2/4;display:flex;flex-direction:column;gap:2px;padding:8px 6px;background:#f8fafc;border-right:1px solid #d5dce5;overflow:hidden}
.md-nav-item{height:29px;border:0;border-radius:6px;background:transparent;text-align:left;padding:0 10px;font:inherit;color:#334155;cursor:pointer}
.md-nav-item.md-on{background:#dbe8fb;color:#174a8b;font-weight:600}
.md-collapse{margin-top:auto;color:#64748b}
.md-main{display:grid;grid-template-columns:1fr 250px;grid-template-rows:auto auto 1fr auto;gap:8px;padding:8px;overflow:hidden}
.md-bar{grid-column:1/3;display:flex;flex-wrap:wrap;align-items:center;gap:5px}
.md-tabs{display:flex;border:1px solid #c3ccd7;border-radius:7px;overflow:hidden}
.md-tab{height:28px;border:0;border-right:1px solid #d5dce5;background:#fff;padding:0 9px;font:inherit;cursor:pointer}
.md-tab.md-on{background:#24324a;color:#fff}
.md-filter{background:#fff7e6;border-color:#f0c36d}
.md-select{display:inline-flex;align-items:center;gap:4px;color:#475569}
.md-select select{height:28px;border:1px solid #b9c3cf;border-radius:6px;background:#fff;font:inherit;padding:0 4px}
.md-top .md-select{color:#c7d2e1}.md-top .md-select select{background:#33445f;border-color:#4b5f80;color:#e9eef5}
.md-toggle{display:inline-flex;align-items:center;gap:4px;color:#475569}
.md-kpis{grid-column:1/2;display:grid;grid-template-columns:repeat(6,1fr);gap:6px}
.md-kpi{background:#fff;border:1px solid #d5dce5;border-radius:8px;padding:6px 8px}
.md-kpi-head{display:flex;justify-content:space-between;align-items:center;color:#64748b}
.md-kpi-head .md-icon{height:20px;width:20px;border:0}
.md-kpi strong{display:block;font-size:18px;margin-top:2px}
.md-kpi em{font-style:normal;color:#0f8a5f;font-size:11px}
.md-chart,.md-table,.md-side{background:#fff;border:1px solid #d5dce5;border-radius:8px;padding:6px 8px;overflow:hidden}
.md-chart{grid-column:1/2}
.md-side{grid-column:2/3;grid-row:2/5;display:flex;flex-direction:column;gap:5px}
.md-table{grid-column:1/2}
.md-panel-head{display:flex;flex-wrap:wrap;align-items:center;gap:5px;font-weight:600;color:#334155;margin-bottom:4px}
.md-panel-head>span{margin-right:auto}
.md-chip{height:24px;padding:0 8px;border-radius:12px;border:1px solid #c3ccd7;background:#f1f5f9;font:inherit;cursor:pointer}
.md-chart-svg{width:100%;height:130px}
.md-chart-svg rect{fill:#9cc3f5}.md-chart-svg polyline{fill:none;stroke:#2f7de1;stroke-width:2.5}
.md-table table{width:100%;border-collapse:collapse;font-size:11.5px}
.md-table th{text-align:left;color:#64748b;font-weight:600;border-bottom:1px solid #e2e8f0;padding:3px 4px}
.md-table td{border-bottom:1px solid #eef2f6;padding:3px 4px;white-space:nowrap}
.md-status{font-weight:600}.md-delayed,.md-exception{color:#c2410c}.md-delivered{color:#0f8a5f}.md-in-transit{color:#2563eb}
.md-mini{height:22px;padding:0 6px;border:1px solid #c3ccd7;border-radius:5px;background:#fff;font:inherit;font-size:11px;cursor:pointer;margin-left:2px}
.md-mini.md-on{background:#24324a;color:#fff}
.md-row-actions{text-align:right}.md-row-actions .md-icon{height:22px;width:22px}
.md-pages{display:flex;justify-content:flex-end;gap:3px;margin-top:4px}
.md-alert{display:flex;align-items:center;gap:6px;background:#fff7ed;border:1px solid #fed7aa;border-radius:6px;padding:4px 6px}
.md-alert span{flex:1}
.md-quick{display:grid;grid-template-columns:1fr 1fr;gap:4px}
.md-tile{height:34px;border:1px solid #c3ccd7;border-radius:6px;background:#f8fafc;font:inherit;cursor:pointer}
.md-foot{display:flex;align-items:center;gap:8px;padding:0 10px;background:#f8fafc;border-top:1px solid #d5dce5;color:#64748b}
.md-foot .md-btn{height:22px;font-size:11px}
