/* ECEUH EM Waves lessons, October 8 2026. A calm study workspace on the site's
   warm paper: a lavender bench for the 3D scene, white sheets for the worked
   solution, serif equations, scarlet for E/voltage and actions, blue for H and
   current, green for power. Native fonts from tokens.css; same-origin only. */
.emw {
  --paper: #f4f2ec;
  --paper-deep: #ebe8e0;
  --white: #ffffff;
  --ink: #1a1712;
  --muted: #5f5b55;
  --line: #dcd8cf;
  --line-strong: #c4bfb4;
  --red: #c8102e;
  --red-deep: #a30c25;
  --rose: #fbe9ec;
  --blue: #3a4fc9;
  --lav: #e6ecfb;
  --lav-deep: #c9d4f3;
  --green: #17683f;
  --amber: #f3c13a;
  --amber-soft: #fdf3d3;
  --r: 22px;
  --r-sm: 12px;
  --r-pill: 100px;
  --pad: clamp(16px, 4vw, 48px);
  --wrap: 1400px;
  --sans: var(--site-sans, -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui, sans-serif);
  --serif: var(--site-serif, "New York", ui-serif, Georgia, serif);
  --mono: var(--site-mono, ui-monospace, "SF Mono", Menlo, monospace);
}
*, *::before, *::after { box-sizing: border-box; }
html { color-scheme: light; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; background: #f4f2ec; scroll-padding-top: 96px; }
body.emw { margin: 0; background: var(--paper); color: var(--ink); font-family: var(--sans); font-size: 1rem; line-height: 1.55; -webkit-font-smoothing: antialiased; overflow-wrap: break-word; }
.emw img, .emw svg { display: block; max-width: 100%; }
.emw button, .emw input { font: inherit; color: inherit; }
.emw button { cursor: pointer; touch-action: manipulation; }
.emw a { color: var(--red); text-underline-offset: 3px; text-decoration-thickness: 1px; }
.emw a:hover { text-decoration-thickness: 2px; }
.emw :focus-visible { outline: 3px solid var(--red); outline-offset: 3px; border-radius: 8px; }
.emw [hidden] { display: none !important; }
.emw h1, .emw h2, .emw h3, .emw h4, .emw p { margin: 0; }
.emw-wrap { width: 100%; max-width: var(--wrap); margin-inline: auto; padding-inline: var(--pad); }
.skip { position: absolute; top: -100px; left: 16px; z-index: 50; padding: 12px 18px; background: var(--ink); color: #fff; border-radius: 8px; font-weight: 600; }
.skip:focus { top: 12px; }

/* Header capsule */
.emw-top { position: sticky; top: 0; z-index: 30; padding: 12px var(--pad) 0; pointer-events: none; }
.emw-top-inner {
  pointer-events: auto; max-width: calc(var(--wrap) - 2 * 16px); margin-inline: auto;
  display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 60px;
  padding: 6px 8px 6px 14px; border-radius: var(--r-pill);
  background: rgba(250, 249, 245, .86); border: 1px solid rgba(26, 23, 18, .08);
  -webkit-backdrop-filter: blur(16px) saturate(150%); backdrop-filter: blur(16px) saturate(150%);
  box-shadow: 0 8px 30px rgba(26, 23, 18, .06);
}
.brand { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 44px; min-width: 44px; color: var(--ink) !important; text-decoration: none; font-weight: 700; letter-spacing: -.01em; }
.brand img { width: 30px; height: 30px; border-radius: 8px; }
.top-link { display: inline-flex; align-items: center; min-height: 44px; padding: 0 16px; border-radius: var(--r-pill); color: var(--ink) !important; text-decoration: none; font-weight: 600; font-size: .9375rem; background: var(--white); border: 1px solid var(--line); }
.top-link:hover { border-color: var(--line-strong); }

/* Page head */
.page-head { padding-top: clamp(28px, 5vw, 56px); padding-bottom: 20px; display: grid; gap: 14px; }
.eyebrow { font-size: .75rem; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: var(--blue); }
.page-head h1 { font-size: clamp(2.1rem, 5vw, 4rem); font-weight: 650; line-height: 1; letter-spacing: -.04em; text-wrap: balance; max-width: 18ch; }
.lede { font-size: clamp(1.0625rem, 1.3vw, 1.2rem); color: var(--muted); max-width: 54ch; }
.lede:empty, .lesson-status:empty { display: none; }
.lesson-status { color: var(--red-deep); font-weight: 600; }
.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: .9375rem; color: var(--muted); }
.crumbs a { display: inline-flex; align-items: center; min-height: 44px; font-weight: 600; }

/* Hub */
.hub { padding-bottom: clamp(48px, 8vw, 96px); }
.exam-list { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 0; border-top: 1px solid var(--line-strong); }
.exam-row { display: grid; gap: 14px; padding: 22px 0 24px; border-bottom: 1px solid var(--line); }
.exam-row-head { display: grid; gap: 4px; }
.exam-link { display: inline-flex; flex-wrap: wrap; align-items: baseline; gap: 4px 14px; min-height: 44px; color: var(--ink) !important; text-decoration: none; }
.exam-link:hover .exam-term { color: var(--red); }
.exam-term { font-size: clamp(1.6rem, 3vw, 2.25rem); font-weight: 650; letter-spacing: -.035em; line-height: 1.1; }
.exam-date { font-family: var(--mono); font-size: .875rem; color: var(--muted); }
.exam-meta { font-size: .875rem; color: var(--muted); }
.exam-problems { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.problem-chip {
  display: inline-flex; align-items: center; gap: 8px; min-height: 44px; max-width: 100%; padding: 8px 16px 8px 8px;
  border-radius: var(--r-pill); background: var(--white); border: 1px solid var(--line); color: var(--ink) !important; text-decoration: none; font-size: .9375rem;
}
.problem-chip:hover { border-color: var(--red); }
.chip-num { flex: none; display: inline-grid; place-items: center; min-width: 30px; height: 30px; padding: 0 6px; border-radius: var(--r-pill); background: var(--lav); color: var(--blue); font-weight: 700; font-size: .8125rem; }
.chip-title { font-weight: 600; }
.chip-parts { color: var(--muted); font-size: .8125rem; white-space: nowrap; }
.hub-foot { margin-top: 24px; color: var(--muted); font-size: .9375rem; max-width: 70ch; }

/* Lesson */
.lesson { padding-bottom: 32px; }
.lesson-head { padding-bottom: 18px; }
.problem-tabs, .part-tabs { display: flex; flex-wrap: wrap; gap: 8px; }
.tab {
  display: inline-flex; flex-direction: column; align-items: flex-start; justify-content: center; gap: 0; min-height: 44px; max-width: 100%;
  padding: 8px 18px; border-radius: 18px; border: 1px solid var(--line); background: var(--white); text-align: left;
}
.tab:hover { border-color: var(--line-strong); }
.tab[aria-selected="true"] { background: var(--ink); border-color: var(--ink); color: var(--white); }
.tab-main { font-weight: 700; font-size: .9375rem; line-height: 1.25; }
.tab-sub { font-size: .8125rem; line-height: 1.3; opacity: .82; }
.part-tabs .tab { min-width: 54px; align-items: center; border-radius: var(--r-pill); }

.jump-link { display: inline-flex; align-items: center; min-height: 44px; margin-top: 8px; font-weight: 600; font-size: .9375rem; }
.workspace { display: grid; grid-template-columns: minmax(0, 1fr); gap: 28px; align-items: start; }
.bench { display: grid; gap: 14px; min-width: 0; }

/* Stage */
.stage { margin: 0; border-radius: var(--r); background: var(--lav); border: 1px solid var(--lav-deep); overflow: hidden; }
.scene {
  display: block; width: 100%; aspect-ratio: 4 / 3; touch-action: pan-y; cursor: grab; background: var(--lav);
  --emw-c-ink: #1a1712; --emw-c-muted: #4f5466; --emw-c-line: #b8c1db; --emw-c-stage: #e6ecfb; --emw-c-paper: #eef2fd; --emw-c-white: #ffffff;
  --emw-c-e: #c8102e; --emw-c-h: #2f43b8; --emw-c-s: #17683f; --emw-c-metal: #6c7384; --emw-c-copper: #c4870f;
  --emw-c-dielectric: #9aa8c9; --emw-c-earth: #8b6a43; --emw-c-hl: #f3c13a; --emw-c-probe: #8a4b00; --emw-c-fault: #7b2d8e;
}
.scene:active { cursor: grabbing; }
.scene:focus-visible { outline-offset: -4px; border-radius: var(--r); }
.toolbar { display: flex; flex-wrap: wrap; gap: 6px; padding: 10px 12px 0; }
.tool { min-width: 44px; min-height: 44px; padding: 0 10px; border-radius: var(--r-pill); border: 1px solid var(--lav-deep); background: var(--white); font-size: 1.1rem; line-height: 1; }
.tool-word { font-size: .875rem; font-weight: 600; padding: 0 14px; }
.tool:hover { border-color: var(--blue); }
.stage-cap { display: grid; gap: 8px; padding: 10px 14px 14px; }
.scene-help { font-size: .8125rem; color: #3f4456; }
.legend { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: .8125rem; color: #2c3040; }
.legend-item { display: inline-flex; align-items: center; gap: 8px; }
.swatch { flex: none; display: inline-block; width: 24px; height: 0; border-top: 3px solid currentColor; }
.swatch-dashed { border-top-style: dashed; }
.swatch-dot { width: 11px; height: 11px; border: 2px solid currentColor; border-radius: 50%; }
.swatch-front { width: 18px; height: 12px; border: 0; border-left: 2px dashed currentColor; }
.swatch-e { color: #c8102e; } .swatch-h { color: #2f43b8; } .swatch-s { color: #17683f; } .swatch-ink { color: var(--ink); }
.swatch-copper { color: #c4870f; } .swatch-probe { color: #8a4b00; }
.scene-note { font-size: .8125rem; color: #3f4456; font-style: italic; }
.scene-note:empty { display: none; }

/* Dial: the one time/phase control that drives scene and plots */
.dial { display: grid; gap: 10px; padding: 14px 16px; border-radius: var(--r); background: var(--white); border: 1px solid var(--line); }
.dial-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 14px; }
.play { min-height: 44px; min-width: 84px; padding: 0 20px; border-radius: var(--r-pill); border: 0; background: var(--red); color: #fff; font-weight: 700; }
.play:hover { background: var(--red-deep); }
.play[aria-pressed="true"] { background: var(--ink); }
.dial-slider { display: grid; gap: 2px; min-width: 0; }
.dial-label { font-size: .875rem; font-weight: 700; color: var(--muted); }
.dial-value { font-family: var(--mono); font-size: 1rem; font-variant-numeric: tabular-nums; min-width: 9ch; text-align: right; }
.emw input[type="range"] { width: 100%; min-height: 44px; margin: 0; accent-color: var(--red); background: transparent; }
.moments { display: flex; flex-wrap: wrap; gap: 6px; }
.moment { min-height: 44px; padding: 0 14px; border-radius: var(--r-pill); border: 1px solid var(--line); background: var(--paper); font-size: .875rem; font-weight: 600; }
.moment:hover { border-color: var(--red); }
.controls { display: grid; gap: 10px; padding: 14px 16px; border-radius: var(--r); background: var(--white); border: 1px solid var(--line); }
.control { display: grid; gap: 2px; }
.control-top { display: flex; justify-content: space-between; gap: 12px; font-size: .9375rem; }
.control-name { font-weight: 600; }
.control-value { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.control-help { font-size: .8125rem; color: var(--muted); }

.words { padding: 14px 16px; border-radius: var(--r); background: var(--paper-deep); }
.words-title { font-size: .75rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; }
.scene-words { margin: 0; padding-left: 18px; display: grid; gap: 4px; font-size: .9375rem; }

/* Plots */
.plots { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; }
.plot-card { margin: 0; display: grid; gap: 8px; padding: 14px 14px 12px; border-radius: var(--r); background: var(--white); border: 1px solid var(--line); min-width: 0; }
.plot-card.is-current { border-color: var(--red); box-shadow: 0 0 0 1px var(--red); }
.plot-cap { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 10px; font-size: .9375rem; }
.plot-title { font-weight: 650; }
.plot-tag { font-size: .75rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; padding: 2px 9px; border-radius: var(--r-pill); }
.plot-tag.is-asked { background: var(--rose); color: var(--red-deep); }
.plot-tag.is-helper { background: var(--lav); color: #2f3f9f; }
.plot-body { min-width: 0; overflow: hidden; }
.plot-note { font-size: .8125rem; color: var(--muted); }
.pl { font-family: var(--sans); overflow: visible; }
.pl-grid { stroke: #ece9e2; stroke-width: 1; }
.pl-zero { stroke: #8f8a80; stroke-width: 1; }
.pl-axis { stroke: #5f5b55; stroke-width: 1.2; }
.pl-tick { font-size: 11px; fill: #5f5b55; font-variant-numeric: tabular-nums; }
.pl-break { font-size: 10.5px; fill: #1a1712; font-weight: 600; font-variant-numeric: tabular-nums; }
.pl-axis-label { font-size: 11.5px; fill: #5f5b55; font-weight: 600; }
.pl-trace { fill: none; stroke: #c8102e; stroke-width: 2.4; stroke-linejoin: round; }
.pl-src { stroke: #c8102e; }
.pl-value { font-size: 12px; fill: #1a1712; font-weight: 700; font-variant-numeric: tabular-nums; paint-order: stroke; stroke: #ffffff; stroke-width: 3px; }
.pl-chip { fill: #ffffff; stroke: #dcd8cf; }
.pl-wave { stroke: #1a1712; stroke-width: 1.6; }
.pl-trail { stroke-dasharray: 5 4; stroke: #5f5b55; }
.pl-iface { stroke: #a9a395; stroke-width: 1.2; stroke-dasharray: 3 3; }
.pl-coef { font-size: 11px; fill: #2f3f9f; font-weight: 700; }
.pl-cursor-line { stroke: #c8102e; stroke-width: 1.4; stroke-dasharray: 4 3; }
.pl-cursor-dot { fill: #c8102e; stroke: #fff; stroke-width: 1.5; }
.pl-cursor-label { font-size: 11.5px; fill: #a30c25; font-weight: 700; font-variant-numeric: tabular-nums; }
.pl-front-line { stroke: #1a1712; stroke-width: 1.2; stroke-dasharray: 5 3; }
.pl-kink .pl-front-line { stroke-dasharray: 1.5 3; }
.pl-front-arrow { fill: none; stroke: #1a1712; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.pl-ref { stroke: #17683f; stroke-width: 1.4; stroke-dasharray: 6 4; }
.pl-mark { fill: #ffffff; stroke: #1a1712; stroke-width: 2; }
.pl-mark.is-min { fill: #1a1712; }
.pl-trace.is-alt { stroke: #2f43b8; stroke-dasharray: 6 4; }
.pl-trace.is-green { stroke: #17683f; }
.sm-rim { fill: #fbfbfd; stroke: #5f5b55; stroke-width: 1.4; }
.sm-line { fill: none; stroke: #d9d6ce; stroke-width: 1; }
.sm-unit { fill: none; stroke: #2f43b8; stroke-width: 1.8; }
.sm-swr { fill: none; stroke: #5f5b55; stroke-width: 1.2; stroke-dasharray: 5 4; }
.sm-arc { fill: none; stroke: #c8102e; stroke-width: 2.6; }
.sm-arc.is-stub { stroke: #17683f; }
.sm-pt { fill: #1a1712; stroke: #fff; stroke-width: 1.5; }
.sm-pt.is-goal { fill: #c8102e; }
.sm-ptlab { font-size: 12px; font-weight: 700; fill: #1a1712; paint-order: stroke; stroke: #fff; stroke-width: 3px; }
.sm-note { font-size: 11.5px; font-weight: 600; fill: #a30c25; paint-order: stroke; stroke: #fff; stroke-width: 3px; }
.sm-tag { font-size: 11px; fill: #5f5b55; }

/* Worked-solution sheet */
.sheet { display: grid; gap: 18px; padding: clamp(18px, 3vw, 30px); border-radius: var(--r); background: var(--white); border: 1px solid var(--line); min-width: 0; }
.sheet-kicker { font-size: .75rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--blue); }
.sheet-title { font-size: clamp(1.45rem, 2.4vw, 2rem); font-weight: 650; letter-spacing: -.03em; line-height: 1.1; margin-top: -8px; }
.sheet h3 { font-size: .75rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin-bottom: 8px; }
.prompt { display: grid; gap: 8px; font-size: 1rem; }
.notice { display: grid; gap: 6px; padding: 14px 16px; border-left: 4px solid var(--red); border-radius: 0 var(--r-sm) var(--r-sm) 0; background: var(--rose); font-size: .9375rem; }
.notice-kicker { font-size: .75rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--red-deep); }
.start { padding: 14px 16px; border-radius: var(--r-sm); background: var(--lav); }
.start h3 { color: #2f3f9f; }
.givens { margin: 0; display: grid; gap: 0; border-top: 1px solid var(--line); }
.given { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.6fr); gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.given dt { font-weight: 600; font-size: .9375rem; }
.given dd { margin: 0; font-family: var(--serif); font-size: 1rem; }
.conventions ul { margin: 0; padding-left: 18px; display: grid; gap: 4px; font-size: .9375rem; color: #3b3832; }
.part { display: grid; gap: 16px; }
.part-ask { font-size: 1.0625rem; font-weight: 600; }
.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; counter-reset: none; }
.step { display: grid; gap: 8px; padding: 14px 16px 16px; border-radius: var(--r-sm); border: 1px solid var(--line); background: #fdfcf9; }
.step-head { display: flex; align-items: baseline; gap: 10px; }
.step-num { flex: none; display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--ink); color: #fff; font-size: .8125rem; font-weight: 700; }
.step-title { font-size: 1rem; font-weight: 650; line-height: 1.35; }
.step-why { font-size: .9375rem; color: #3b3832; padding-left: 12px; border-left: 3px solid var(--lav-deep); }
.eq { display: grid; grid-template-columns: 92px minmax(0, 1fr); gap: 10px; align-items: baseline; }
.eq-kind { font-size: .6875rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); padding-top: 3px; }
.eq-body { display: grid; gap: 3px; min-width: 0; }
.eq-line { font-family: var(--serif); font-size: 1.0625rem; line-height: 1.5; font-variant-numeric: lining-nums; }
.eq-r .eq-line { font-weight: 600; }
.eq-r .eq-kind { color: var(--red-deep); }
.eq sub, .eq sup, .answer sub, .answer sup, .given sub, .given sup, .prompt sub, .prompt sup, .scene-words sub, .scene-words sup { font-size: .72em; line-height: 0; }
.vec { font-weight: 700; }
.show-btn { justify-self: start; min-height: 44px; padding: 0 16px; border-radius: var(--r-pill); border: 1px solid var(--line-strong); background: var(--white); font-size: .875rem; font-weight: 600; }
.show-btn:hover { border-color: var(--blue); }
.show-btn[aria-pressed="true"] { background: var(--amber-soft); border-color: #c99a12; }
.answer { display: grid; gap: 6px; padding: 16px 18px; border-radius: var(--r-sm); background: var(--ink); color: #fff; }
.answer-kicker { font-size: .75rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: #ffb3bd; }
.answer-line { font-family: var(--serif); font-size: 1.125rem; line-height: 1.5; }

.exam-pager { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px; padding-top: 28px; }
.pager-link { display: inline-flex; align-items: center; min-height: 44px; padding: 0 18px; border-radius: var(--r-pill); border: 1px solid var(--line); background: var(--white); color: var(--ink) !important; text-decoration: none; font-weight: 600; }
.pager-link:hover { border-color: var(--red); }
.missing { padding-bottom: 80px; font-size: 1.0625rem; }
.nojs { padding-block: 40px; }

.emw-foot { margin-top: 40px; padding: 28px 0 40px; background: #141414; color: #b9b5ad; font-size: .875rem; }
.emw-foot .emw-wrap { display: grid; gap: 8px; }
.emw-foot a { color: #fff; display: inline-flex; align-items: center; min-height: 44px; }

@media (min-width: 700px) {
  .scene { aspect-ratio: 16 / 10; }
  .plots { grid-template-columns: repeat(auto-fit, minmax(330px, 1fr)); }
  .plot-card.is-wide { grid-column: 1 / -1; }
}
@media (min-width: 1100px) {
  .jump-link { display: none; }
  .workspace { grid-template-columns: minmax(0, 1.22fr) minmax(380px, .78fr); gap: 32px; }
  .exam-row { grid-template-columns: minmax(240px, .32fr) minmax(0, 1fr); align-items: start; }
}
@media (max-width: 560px) {
  .emw-top { padding: 10px 10px 0; }
  .emw-top-inner { min-height: 56px; padding: 4px 4px 4px 10px; }
  .top-link { padding: 0 12px; font-size: .8125rem; }
  .dial-row { grid-template-columns: auto minmax(0, 1fr); }
  .dial-value { grid-column: 1 / -1; text-align: left; }
  .eq { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .given { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .tab { padding: 8px 14px; }
}
@media (max-width: 380px) {
  .brand span { display: none; }
}
@media (prefers-reduced-motion: no-preference) {
  .tab, .tool, .moment, .show-btn, .problem-chip, .pager-link, .play { transition: background-color .18s ease, border-color .18s ease, color .18s ease; }
}
.pl-small { font-size: .78em; }
.pl-cancel { font-size: 11px; font-weight: 700; fill: #17683f; paint-order: stroke; stroke: #fff; stroke-width: 3px; }
.sm-tick { stroke: #5f5b55; stroke-width: 1; }
.sm-wtg-label { font-size: 10px; fill: #3b3832; font-variant-numeric: tabular-nums; }
.sm-dir { fill: none; stroke: #5f5b55; stroke-width: 1.2; marker-end: none; }
