:root {
  /* Colors and fonts come from the shared design system (/assets/design.css);
     these names keep the rest of this stylesheet unchanged. Scene, particle and
     field colors carry meaning and stay as they were. */
  --brand-accent: var(--accent);
  --brand-accent-strong: var(--accent-hover);
  --bg-color: var(--bg);
  --bg-pattern: var(--bg-grid);
  --text-main: var(--ink);
  --text-secondary: var(--ink-2);
  --brand-primary: var(--accent);
  --scene-accent: #0D9488;
  --scene-accent-strong: #0F766E;
  --card-bg: var(--surface);
  --card-border: var(--line);
  --card-shadow: var(--shadow-1);
  --soft-shadow: var(--shadow-1);
  --muted-bg: var(--surface-3);
  --input-border: var(--line-strong);
  --nav-bg: var(--surface);
  --nav-border: var(--line);
  --viewer-bg: var(--surface-3);
  --overlay-bg: var(--surface);
  --focus: var(--accent);
  --electron: #1675BB;
  --positive: #B7791F;
  --proton: #D45132;
  --neutron: #657481;
  --alpha: #B5179E;
  --photon: #7C3AED;
  --antineutrino: #8E8A84;
  --undecayed: #D45132;
  --decayed: #9DB4B0;
  --paper: #EFE6CF;
  --aluminum: #AEB9C4;
  --lead: #4A5360;
  --correct-border: #3F7A55;
  --reaction-arrow: #B45309;
}

[data-theme="dark"] {
  --scene-accent: #5EEAD4;
  --scene-accent-strong: #2DD4BF;
  --electron: #4BA3E3;
  --positive: #E0A445;
  --proton: #EF6A48;
  --neutron: #8C9AA6;
  --alpha: #E879F9;
  --photon: #A78BFA;
  --antineutrino: #8F8B84;
  --undecayed: #EF6A48;
  --decayed: #3F5A57;
  --paper: #D9CFB4;
  --aluminum: #8E9AA6;
  --lead: #5B6573;
  --correct-border: #4ADE80;
  --reaction-arrow: #FBBF24;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background-color: var(--bg-color);
  background-image: radial-gradient(var(--bg-pattern) 1px, transparent 1px);
  background-size: 30px 30px;
  color: var(--text-main);
  font: 16px/1.65 var(--font-body);
}
button, a { -webkit-tap-highlight-color: transparent; }
button { font: inherit; cursor: pointer; color: inherit; }
a { color: inherit; text-underline-offset: 4px; }
button:focus-visible, a:focus-visible, #viewer:focus-visible, select:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
.mono { font-family: var(--font-mono); }

/* Floating banner */
.banner {
  position: sticky;
  top: var(--standalone-top);
  z-index: 20;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 6px max(20px, env(safe-area-inset-right)) 6px max(20px, env(safe-area-inset-left));
  background: var(--nav-bg);
  border-bottom: 1px solid var(--nav-border);
  box-shadow: var(--soft-shadow);
}

/* Apps keep a plain title; one thin spectrum line under the banner marks the app as PanPhy. */
.banner::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 2px;
  background: var(--spectrum);
  opacity: 0.85;
  pointer-events: none;
}
.banner-logo { justify-self: start; display: flex; align-items: center; min-height: 48px; line-height: 0; }
.banner-logo img { display: block; width: 38px; height: 38px; object-fit: contain; }
.banner-title {
  justify-self: center;
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 600;
  letter-spacing: -0.03em;
  color: var(--ink);
}
.banner-actions { justify-self: end; display: flex; gap: 8px; align-items: center; }
#theme-button { --panphy-theme-button-size: 48px; }

main, footer { width: calc(100% - 48px); max-width: 1320px; margin: auto; }
.eyebrow { margin: 0; font-family: var(--font-mono); font-size: .76rem; letter-spacing: .12em; font-weight: 600; color: var(--brand-primary); }
.intro { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 30px 0 24px; }
.intro p { margin: 0; }
.intro > p { color: var(--text-secondary); border-left: 3px solid var(--card-border); padding-left: 22px; }
h1, h2 { font-family: var(--font-display); font-weight: 600; letter-spacing: -0.02em; }
h1 { font-size: clamp(1.8rem, 3.2vw, 3rem); letter-spacing: -.03em; line-height: 1.1; margin: 10px 0 0; }
h1 span { color: var(--brand-primary); }

/* Model chooser */
.models { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 20px; }
.models button {
  display: grid;
  grid-template-rows: auto auto 1fr;
  align-content: start;
  gap: 2px;
  min-height: 100px;
  padding: 14px 18px;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 16px;
  box-shadow: var(--card-shadow);
  text-align: left;
  transition: border-color .15s, background .15s, transform .15s;
}
.models button > span { font-family: var(--font-mono); font-size: .74rem; letter-spacing: .08em; font-weight: 600; color: var(--text-secondary); }
.models strong { font-size: 1.15rem; line-height: 1.25; }
.models small { color: var(--text-secondary); font-size: .85rem; }
.models button:hover { border-color: var(--brand-accent); transform: translateY(-1px); }
.models button[aria-pressed=true] { border-color: var(--brand-accent-strong); background: var(--brand-accent-strong); color: var(--accent-ink); }
[data-theme="dark"] .models button[aria-pressed=true] { background: var(--brand-accent); border-color: var(--brand-accent); color: var(--accent-ink); }
.models button[aria-pressed=true] > span, .models button[aria-pressed=true] small { color: inherit; opacity: .85; }

.lab-strip { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 12px; color: var(--text-secondary); font-size: .8rem; }
.lab-strip b { margin-left: 12px; color: var(--text-main); }

/* Workspace */
.workspace {
  scroll-margin-top: 72px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(330px, 380px);
  grid-template-areas: "viewer console" "guide guide";
  border: 1px solid var(--card-border);
  border-radius: 20px;
  overflow: hidden;
  background: var(--card-bg);
  box-shadow: var(--card-shadow);
}
.viewer-panel { grid-area: viewer; display: flex; flex-direction: column; min-width: 0; padding: 20px; background: var(--viewer-bg); }
.viewer-heading { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; font-family: var(--font-mono); font-size: .76rem; font-weight: 600; letter-spacing: .08em; }
#scene-title { margin-right: auto; }
.scale { color: var(--text-secondary); font-size: .68rem; border: 1px solid var(--input-border); border-radius: 999px; padding: 4px 10px; }
#fullscreen { --panphy-fs-size: 48px; }
body.viewer-expanded { overflow: hidden; }
.workspace.is-fullscreen { position: fixed; inset: 0; z-index: 1000; width: 100%; height: 100%; height: 100dvh; display: block; border: 0; border-radius: 0; box-shadow: none; background: var(--viewer-bg); }
.workspace.is-fullscreen aside { display: none; }
.workspace.is-fullscreen .console { border: 0; padding: 16px 0 0; background: none; }
.workspace.is-fullscreen .viewer-panel { height: 100%; overflow: auto; padding: max(16px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) max(16px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left)); }
.workspace.is-fullscreen .viewer-panel > :not(#viewer) { flex-shrink: 0; }
.workspace.is-fullscreen .viewer-heading { position: sticky; top: 0; z-index: 3; background: var(--viewer-bg); padding-bottom: 8px; }
.workspace.is-fullscreen #viewer { flex: 1 0 220px; height: 0; min-height: 220px; }
/* Wide screens: the controls and the explanation share a right-hand column beside the 3D view. */
@media (min-width: 900px) {
  .workspace.is-fullscreen { display: grid; grid-template-columns: minmax(0, 1fr) clamp(320px, 30vw, 440px); grid-template-areas: "viewer guide"; }
  .workspace.is-fullscreen aside { display: block; border: 0; border-left: 1px solid var(--card-border); min-height: 0; overflow: auto; padding: max(20px, env(safe-area-inset-top)) max(20px, env(safe-area-inset-right)) max(20px, env(safe-area-inset-bottom)) 20px; }
  .workspace.is-fullscreen aside .console { padding: 0 0 20px; margin-bottom: 20px; border-bottom: 1px solid var(--card-border); }
}

/* contain: size keeps the canvas pixel size from feeding back into the viewer height. */
/* The 3D view grows with the screen, so it fills most of a laptop or projector screen when the sim is scrolled into view. */
#viewer { position: relative; display: flex; flex-direction: column; flex: 1; min-height: clamp(460px, calc(100vh - 240px), 820px); contain: size; margin: 8px 0 12px; border-radius: 14px; touch-action: none; overflow: hidden; }
#viewer.is-hovering { cursor: pointer; }
#viewer > canvas { display: block; width: 100%; height: 0; flex: 1; min-height: 0; align-self: stretch; }
#load-status { position: absolute; inset: 30% 10%; margin: 0; text-align: center; color: var(--text-secondary); }

.overlay { position: absolute; z-index: 2; pointer-events: none; font-size: .74rem; }
.legend { left: 10px; bottom: 10px; right: 10px; display: flex; flex-wrap: wrap; gap: 6px; }
.legend > span { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px 3px 4px; border-radius: 999px; background: var(--overlay-bg); border: 1px solid var(--card-border); }
.legend i { font-style: normal; display: inline-grid; place-items: center; border-radius: 50%; width: 18px; height: 18px; font-size: .72rem; font-weight: 800; color: #fff; }
.legend .electron { background: var(--electron); }
.legend .positive { background: var(--positive); }
.legend .neutron { background: var(--neutron); }
.legend .alpha { background: var(--alpha); }
.legend .proton { background: var(--proton); }
.legend .gamma { background: var(--photon); }
.legend .antineutrino { background: var(--antineutrino); }
.legend .undecayed { background: var(--undecayed); }
.legend .decayed { background: var(--decayed); }
.legend .u238 { background: var(--aluminum); }
.legend .rod { background: var(--lead); border-radius: 3px; }
.gesture { top: 8px; left: 10px; margin: 0; color: var(--text-secondary); }

/* Nuclear equation */
.equation { top: 8px; right: 8px; max-width: calc(100% - 16px); padding: 8px 12px; border-radius: 12px; background: var(--overlay-bg); border: 1px solid var(--card-border); font-family: var(--font-mono); font-size: .95rem; }
.equation .eq { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 8px; }
.nuclide { display: inline-flex; align-items: center; font-weight: 600; }
.nuclide .nums { display: inline-flex; flex-direction: column; align-items: flex-end; margin-right: 2px; font-size: .66rem; line-height: 1.15; }
.nuclide.alpha { color: var(--alpha); }
.nuclide.electron { color: var(--electron); }
.nuclide.gamma { color: var(--photon); }
.nuclide.neutron { color: var(--neutron); }
.eq .coef { font-weight: 600; margin-right: -2px; }
.nuclide.unknown { color: var(--text-secondary); }
.equation .check { margin-top: 4px; font-size: .68rem; color: var(--text-secondary); text-align: right; }
.equation .check b { color: var(--correct-border); font-weight: 600; }

/* Chain and fusion graph: in the control column, or above the 3D view on phones */
.graph { padding: 6px; border-radius: 12px; background: var(--overlay-bg); border: 1px solid var(--card-border); }
.graph canvas { display: block; width: 100%; height: auto; aspect-ratio: 290 / 190; flex: none; min-height: 0; }
.graph-stats { margin: 4px 4px 0; font-size: .7rem; line-height: 1.4; color: var(--text-secondary); }
.graph-stats b { color: var(--undecayed); font-weight: 600; }



/* Playback bar under the 3D view */
.toolbar { display: flex; flex-wrap: wrap; gap: 8px; }
.toolbar button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 8px 14px;
  border: 1px solid var(--input-border);
  border-radius: 12px;
  background: var(--card-bg);
  font-size: .85rem;
  font-weight: 700;
  transition: border-color .15s, background .15s;
}
.toolbar button:hover { border-color: var(--brand-accent); background: var(--muted-bg); }
.toolbar svg { width: 18px; height: 18px; flex: none; fill: currentColor; }
.toolbar svg .stroke { fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
#motion { min-width: 150px; }
#motion[aria-pressed=false] { border-color: var(--brand-accent-strong); color: var(--brand-accent-strong); }
/* Labels that change keep the width of their widest label, so the bar does not jump. */
[data-reserve] { display: inline-grid; justify-items: center; align-content: center; }
[data-reserve]::after { content: attr(data-reserve); height: 0; overflow: hidden; visibility: hidden; }
button:disabled { cursor: default; opacity: 0.9; }

/* Control column: the main action first, then what it shows, then the settings. */
.console { grid-area: console; display: flex; flex-direction: column; gap: 12px; min-width: 0; padding: 20px; border-left: 1px solid var(--card-border); background: var(--card-bg); }
.fire {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  width: 100%; min-height: 56px; padding: 10px 18px;
  border: 0; border-radius: 14px;
  background: var(--brand-primary); color: var(--accent-ink);
  font-size: 1.02rem; font-weight: 800;
  box-shadow: 0 6px 16px color-mix(in srgb, var(--brand-primary), transparent 72%);
  transition: filter .15s, transform .1s;
}
.fire::before { content: ''; flex: none; width: 20px; height: 20px; background: currentColor; -webkit-mask: var(--fire-icon) center / contain no-repeat; mask: var(--fire-icon) center / contain no-repeat; }
.fire { --fire-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12h12M12 6l6 6-6 6'/%3E%3C/svg%3E"); }
.fire[aria-pressed=true] { --fire-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M7 7h10v10H7z'/%3E%3C/svg%3E"); background: var(--text-main); color: var(--bg-color); box-shadow: none; }
.fire[hidden] { display: none; }
.fire:hover:not(:disabled) { filter: brightness(1.07); }
.fire:active:not(:disabled) { transform: translateY(1px); }
.fire:disabled { opacity: 1; background: var(--muted-bg); color: var(--text-secondary); box-shadow: none; }
/* Second experiments: full width and outlined, filled while they are running. */
.action {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; min-height: 48px; padding: 8px 14px;
  border: 1px solid color-mix(in srgb, var(--brand-primary), transparent 50%); border-radius: 12px;
  background: var(--card-bg); color: var(--brand-primary);
  font-size: .9rem; font-weight: 700;
}
.action:hover:not(:disabled):not([aria-pressed=true]) { background: var(--muted-bg); }
.action[aria-pressed=true] { background: var(--brand-primary); border-color: var(--brand-primary); color: var(--bg-color); }
.action[hidden] { display: none; }
.view-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 8px; }
.view-row button { min-height: 48px; padding: 8px 10px; border: 1px solid var(--input-border); border-radius: 12px; background: var(--card-bg); font-size: .85rem; font-weight: 700; }
.view-row button:hover { border-color: var(--brand-accent); background: var(--muted-bg); }
/* One message says what the model shows and what to try next. Room for five lines, so a longer message does not push the settings around. */
.particle-readout { margin: 0; min-height: calc(7.75em + 20px); padding: 10px 14px; border-radius: 12px; border-left: 3px solid var(--brand-accent); background: var(--muted-bg); color: var(--text-main); font-size: .84rem; line-height: 1.55; }

.sample-controls { display: flex; flex-direction: column; gap: 16px; }
.sample-controls[hidden] { display: none; }
.section { display: flex; flex-direction: column; gap: 8px; }
.section-title { font-family: var(--font-mono); font-size: .7rem; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--text-secondary); }
.choice-row { display: flex; flex-wrap: wrap; gap: 8px; }
.stepper button, .choice-row button {
  min-width: 48px; min-height: 48px; padding: 8px 12px;
  border: 1px solid var(--input-border); border-radius: 12px; background: var(--card-bg);
  font: 700 1.1rem var(--font-body); color: var(--text-main); touch-action: manipulation;
}
.choice-row button { display: inline-flex; align-items: center; justify-content: center; font-size: .85rem; }
.stepper button:hover:not(:disabled), .choice-row button:hover:not(:disabled):not([aria-pressed=true]) { border-color: var(--brand-accent); background: var(--muted-bg); }
/* One-of-several choices are a segmented control: exactly one is lit. */
.segmented { display: grid; grid-auto-columns: 1fr; grid-auto-flow: column; gap: 4px; padding: 4px; border-radius: 14px; background: var(--muted-bg); }
.segmented button { border-color: transparent; background: none; padding: 6px 4px; line-height: 1.2; }
.segmented button[aria-pressed=true] { background: var(--brand-accent-strong); border-color: var(--brand-accent-strong); color: #fff; }
[data-theme="dark"] .segmented button[aria-pressed=true] { background: var(--brand-accent); border-color: var(--brand-accent); color: var(--accent-ink); }

/* Each setting is one row: its name on the left, exact stepping or a menu on the right. */
.setting { display: flex; align-items: center; justify-content: space-between; gap: 10px; border-radius: 12px; }
.setting-label { font-size: .88rem; font-weight: 600; line-height: 1.3; }
label.setting { flex-wrap: wrap; gap: 6px; }
.setting select { flex: 1 1 100%; min-width: 0; min-height: 48px; padding: 8px 10px; border: 1px solid var(--input-border); border-radius: 12px; background: var(--card-bg); color: var(--text-main); font: 600 .85rem var(--font-body); }
.setting select:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
.stepper { display: inline-flex; align-items: center; gap: 4px; flex: none; }
.stepper output, .stepper input {
  display: inline-grid; place-items: center; width: 78px; min-height: 48px; padding: 0 6px;
  border: 1px solid var(--input-border); border-radius: 12px; background: var(--card-bg);
  color: var(--text-main); text-align: center; font: 600 1rem var(--font-mono); letter-spacing: 0;
}
.stepper input { -moz-appearance: textfield; appearance: textfield; }
.stepper input::-webkit-outer-spin-button, .stepper input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.stepper input:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }

aside { grid-area: guide; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 40px; border-top: 1px solid var(--card-border); padding: 26px; background: var(--card-bg); }
aside h2 { font-size: 1.35rem; line-height: 1.15; margin: 10px 0 14px; }
aside p { color: var(--text-secondary); font-size: .92rem; margin: 8px 0 20px; }
h3 { font-size: .88rem; margin: 0; }
.icon { width: 1.15em; height: 1.15em; vertical-align: -0.2em; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.idea h3 .icon { color: var(--brand-accent-strong); }
.idea { border-left: 3px solid var(--brand-accent); border-radius: 0 12px 12px 0; padding: 13px 16px; margin: 20px 0; background: var(--muted-bg); }
.idea p { margin: 6px 0 0; }

.reality { display: flex; gap: 24px; padding: 28px 0; max-width: 1030px; }
.reality > span { font-size: 2rem; color: var(--brand-primary); }
.reality h2 { font-size: 1rem; margin: 0 0 8px; }
.reality p { color: var(--text-secondary); font-size: .9rem; margin: 6px 0; }
footer { display: flex; justify-content: space-between; gap: 20px; border-top: 1px solid var(--card-border); padding: 22px 0 max(30px, env(safe-area-inset-bottom)); color: var(--text-secondary); font-size: .78rem; }
.no-script { padding: 24px; }

@media (max-width: 1100px) {
  .workspace { grid-template-columns: minmax(0, 1fr) 330px; }
  .models strong { font-size: 1.05rem; }
}
/* Narrower screens stack the view, its controls and the explanation. */
@media (max-width: 900px) {
  .workspace { grid-template-columns: 1fr; grid-template-areas: "viewer" "console" "guide"; }
  .console { border-left: 0; border-top: 1px solid var(--card-border); }
  aside { display: block; }
}
@media (min-width: 640px) and (max-width: 900px) {
  .workspace:not(.is-fullscreen) .sample-controls:not([hidden]) { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 24px; align-items: start; }
}
@media (max-width: 760px) {
  main, footer { width: calc(100% - 28px); }
  .banner { padding-left: max(12px, env(safe-area-inset-left)); padding-right: max(12px, env(safe-area-inset-right)); }
  .banner-title { font-size: 0.95rem; }
  .intro { display: block; padding: 22px 0 18px; }
  .intro > p { margin-top: 16px; font-size: .9rem; }
  .intro h1 { font-size: 1.7rem; }
  .models { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .models button { min-height: 84px; padding: 12px; border-radius: 14px; }
  .models strong { font-size: .98rem; }
  .models small { font-size: .76rem; }
  .lab-strip { flex-direction: column; align-items: flex-start; gap: 0; }
  .viewer-panel { padding: 12px; }
  #viewer { flex: none; height: 400px; min-height: 400px; }
  .viewer-heading { font-size: .68rem; }
  .gesture { display: none; }
  .equation { left: 8px; font-size: .82rem; padding: 6px 8px; }
  .equation .eq { justify-content: center; }
  .equation .check { text-align: center; }
  body[data-mode=chain] #viewer, body[data-mode=fusion] #viewer { height: 640px; min-height: 640px; }
  body[data-mode=energy] #viewer { height: 560px; min-height: 560px; }
  #viewer > .graph { margin: 0 0 8px; }
    .console { padding: 16px 12px; }
  .particle-readout { min-height: 72px; }
  .toolbar { gap: 6px; }
  .toolbar button { flex: 1 1 auto; gap: 6px; padding: 8px 10px; white-space: nowrap; font-size: .82rem; }
  #motion { min-width: 0; }
  aside { padding: 20px; }
  .reality { gap: 12px; }
  footer { flex-direction: column; gap: 8px; }
}
@media (prefers-reduced-motion: reduce) {
  .models button, .toolbar button, .fire { transition: none; }
  .models button:hover { transform: none; }
}


/* Binding-energy panel fills the viewer */
.bea { position: absolute; inset: 0; z-index: 1; display: flex; flex-direction: column; gap: 8px; padding: 8px; border-radius: 14px; background: var(--card-bg); border: 1px solid var(--card-border); }
.bea canvas { display: block; width: 100%; height: 0; flex: 1; min-height: 0; cursor: pointer; }
.bea-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 6px 14px; padding: 8px 10px; border-radius: 10px; background: var(--muted-bg); font-size: .72rem; line-height: 1.45; }
.bea-stats span { display: block; color: var(--text-secondary); }
.bea-stats b { display: block; color: var(--text-main); font-size: .86rem; font-weight: 600; }
.bea-stats b.big { color: var(--brand-primary); }

/* On phones the fusion graph sits above the 3D view, so the equation moves to the bottom. */
@media (max-width: 760px) {
  .graph canvas { aspect-ratio: auto; height: 170px; }
  body[data-mode=fusion] .equation { top: auto; bottom: 46px; left: 8px; right: 8px; }
}
