:root {
  --bg: #efebe0;
  --bg-deep: #e4dfd0;
  --card: #fbf9f3;
  --ink: #44403d;
  --blue: #2f6798;
  --green: #4a7a35;
  --orange: #a85a14;
  --red: #b3302a;
  --bar-h: 56px;
  --top-h: 86px;
  --r: 8px;                /* corner radius shared by buttons, boxes, panels and the signal-path strip */
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--bg); color: var(--ink); font-family: "Source Serif 4", Georgia, "Times New Roman", serif; font-size: 18px; line-height: 1.6; -webkit-font-smoothing: antialiased; }

.skip { position: absolute; left: -999px; top: 8px; background: var(--ink); color: var(--bg); padding: 8px 12px; z-index: 20; }
.skip:focus { left: 8px; }

/* ---------- Top bar: where we are, and the signal path ---------- */
.topbar { height: var(--top-h); display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 0 16px; border-bottom: 1px solid rgba(68, 64, 61, 0.25); background: var(--bg); }
.modline { margin: 0; font-size: 0.72rem; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; color: var(--blue); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.path { list-style: none; margin: 0; padding: 0; display: flex; align-items: center; gap: 4px; font-size: 0.72rem; }
.path li { display: flex; align-items: center; gap: 4px; }
.path li > span { padding: 2px 9px; border: 1.5px solid rgba(68, 64, 61, 0.28); border-radius: 999px; opacity: 0.55; white-space: nowrap; }
.path .seen > span { opacity: 0.9; border-color: var(--green); }
.path .on > span { opacity: 1; background: var(--blue); border-color: var(--blue); color: #fff; font-weight: 800; }

.stage { height: calc(100dvh - var(--bar-h) - var(--top-h)); overflow-y: auto; overflow-x: hidden; outline: none; }
.slide { min-height: 100%; animation: fade 0.35s ease; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

/* ---------- Layouts ---------- */
.split { display: grid; grid-template-columns: 1fr 1fr; min-height: 100%; }
.split.img-right .media { order: 2; }
.media { position: relative; min-height: 240px; background: var(--bg-deep); }
.media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.text { display: flex; flex-direction: column; justify-content: center; padding: 48px clamp(28px, 6vw, 96px); }
.text > * { max-width: 34rem; }

.center { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 100%; padding: clamp(16px, 3.5vh, 40px) clamp(20px, 6vw, 80px); }
.center .inner { width: 100%; max-width: 860px; }
.center.narrow .inner { max-width: 720px; }

.full { position: relative; min-height: 100%; display: grid; place-items: center; text-align: center; padding: 48px 24px; color: #fff; }
.full > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.full .shade { position: absolute; inset: 0; background: rgba(0, 0, 0, 0.5); }
.full .inner { position: relative; max-width: 780px; }
.full h1 { color: #fff; text-shadow: 0 2px 14px rgba(0, 0, 0, 0.5); }

/* ---------- Type ---------- */
.rule { border: 0; border-top: 1px solid var(--blue); width: 100%; margin: 0 0 14px; }
.label { color: var(--blue); font-size: 0.7rem; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; margin: 0 0 14px; }
h1, h2 { font-weight: 800; line-height: 1.1; margin: 0 0 14px; outline: none; }
h1 { font-size: clamp(2rem, 4.2vw, 3rem); }
h2 { font-size: clamp(1.5rem, 2.8vw, 2.1rem); }
h3 { font-size: 0.72rem; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: var(--blue); margin: 14px 0 4px; }
p { margin: 0 0 12px; }
.lead { max-width: 680px; }
.chapter-no { color: var(--blue); font-size: 1.15rem; margin: 0; }
strong { font-weight: 800; }
.note { font-size: 0.85rem; font-style: italic; }
.small { font-size: 0.85rem; }
a { color: var(--blue); }
ul.plain { margin: 6px 0 12px; padding-left: 1.2em; }
ul.plain li { margin: 3px 0; }
.callout { border-left: 3px solid var(--blue); padding: 6px 0 6px 14px; margin: 14px 0; font-style: italic; }
.callout strong { display: block; font-style: normal; font-size: 0.7rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--blue); }
.warnbox { border: 1.5px solid var(--orange); background: rgba(168, 90, 20, 0.08); padding: 8px 12px; font-size: 0.9rem; margin: 10px 0; }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

/* ---------- Controls ---------- */
.ctrls { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 24px; margin: 10px 0 6px; }
.ctrls label { display: flex; align-items: center; gap: 10px; font-size: 0.9rem; }
.ctrls input[type="range"] { accent-color: var(--blue); width: min(240px, 42vw); }
.ctrls output { font-weight: 800; min-width: 5.5em; font-variant-numeric: tabular-nums; }
.pill, .seg button, .choice { font: inherit; font-size: 0.9rem; padding: 7px 18px; background: transparent; color: var(--ink); border: 1.5px solid var(--ink); cursor: pointer; }
.pill:hover, .seg button:hover { border-color: var(--blue); color: var(--blue); }
.pill.on, .seg button[aria-pressed="true"] { background: var(--blue); border-color: var(--blue); color: #fff; }
.pill:disabled { opacity: 0.35; cursor: default; }
.seg { display: inline-flex; flex-wrap: wrap; }
.seg button + button { border-left-width: 0; }
.link { font: inherit; font-size: 0.85rem; background: none; border: 0; padding: 0; color: var(--blue); text-decoration: underline; cursor: pointer; }
.readout { font-size: 0.92rem; min-height: 2.8em; margin: 6px 0 0; }
.readout .bad { color: var(--red); font-weight: 800; }
.readout .good { color: var(--green); font-weight: 800; }
.warn { font-size: 0.78rem; font-style: italic; margin: 2px 0 0; }
.demo { text-align: left; margin-top: 8px; }
.demo canvas { display: block; width: 100%; height: clamp(150px, 26vh, 230px); background: #fbf9f3; border: 1px solid rgba(68, 64, 61, 0.3); }
.demo canvas.tall { height: clamp(190px, 34vh, 300px); }
.demo canvas.short { height: clamp(90px, 14vh, 130px); }

/* ---------- Choices, feedback ---------- */
.q { font-size: 1.15rem; margin-bottom: 14px; }
.choices { display: flex; flex-direction: column; gap: 10px; }
.choice { text-align: left; background: rgba(255, 255, 255, 0.45); border-color: rgba(68, 64, 61, 0.35); padding: 12px 16px; font-size: 1rem; }
.choice:hover:not(:disabled) { border-color: var(--blue); }
.choice:disabled { cursor: default; }
.choice.right { border-color: var(--green); background: rgba(74, 122, 53, 0.12); }
.choice.wrong { border-color: var(--red); background: rgba(179, 48, 42, 0.1); }
.choice.dim { opacity: 0.55; }
.feedback { min-height: 3.2em; margin-top: 14px; font-size: 0.95rem; }
.feedback b.ok { color: var(--green); }
.feedback b.no { color: var(--red); }
.check { text-align: left; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 8px; }
.match { width: 100%; border-collapse: collapse; margin: 6px 0 12px; }
.match td { padding: 8px 6px; border-bottom: 1px solid rgba(68, 64, 61, 0.2); vertical-align: middle; }
.match select { font: inherit; font-size: 0.95rem; padding: 6px 8px; max-width: 100%; background: var(--card); color: var(--ink); border: 1.5px solid rgba(68, 64, 61, 0.45); }
.match tr.right select { border-color: var(--green); }
.match tr.wrong select { border-color: var(--red); }

/* ---------- Order chips ---------- */
.order { list-style: none; padding: 0; margin: 0 0 14px; position: relative; max-width: 460px; }
.order li { display: flex; align-items: center; gap: 12px; padding: 10px 14px 10px 16px; margin-bottom: 8px; background: var(--card); border: 1.5px solid rgba(68, 64, 61, 0.35); border-radius: 999px; box-shadow: 0 1px 2px rgba(68, 64, 61, 0.15); touch-action: none; user-select: none; cursor: grab; will-change: transform; }
.order .grip { opacity: 0.45; letter-spacing: -2px; }
.order .name { flex: 1; font-weight: 600; }
.order li.drag { position: relative; z-index: 3; cursor: grabbing; border-color: var(--blue); box-shadow: 0 10px 22px rgba(68, 64, 61, 0.28); }
.order li.right { border-color: var(--green); background: rgba(74, 122, 53, 0.12); }
.order li.wrong { border-color: var(--red); background: rgba(179, 48, 42, 0.1); }
.order.locked li { cursor: default; }
.order button { font: inherit; width: 32px; height: 32px; padding: 0; background: transparent; border: 1.5px solid rgba(68, 64, 61, 0.45); border-radius: 50%; color: var(--ink); cursor: pointer; }
.order button:hover:not(:disabled) { border-color: var(--blue); color: var(--blue); }
.order button:disabled { opacity: 0.25; cursor: default; }

/* ---------- Cards and tables ---------- */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; margin: 10px 0; text-align: left; }
.card { border: 1.5px solid rgba(68, 64, 61, 0.3); background: rgba(255, 255, 255, 0.4); padding: 10px 14px; }
.card h3 { margin-top: 0; }
.card p { font-size: 0.92rem; margin: 0; line-height: 1.45; }
table.data { border-collapse: collapse; width: 100%; font-size: 0.9rem; text-align: left; margin: 8px 0; }
table.data th { color: var(--blue); font-size: 0.72rem; letter-spacing: 0.1em; text-transform: uppercase; padding: 6px 8px; border-bottom: 1px solid var(--blue); }
table.data td { padding: 7px 8px; border-bottom: 1px solid rgba(68, 64, 61, 0.2); vertical-align: top; }
table.data tr:nth-child(even) td { background: var(--bg-deep); }
table.data td:first-child { font-weight: 800; }
.dbscale { list-style: none; padding: 0; margin: 6px 0; font-size: 0.95rem; }
.dbscale li { display: flex; gap: 12px; padding: 4px 0; border-bottom: 1px solid rgba(68, 64, 61, 0.15); }
.dbscale b { flex: 0 0 6em; font-weight: 800; }
.dbscale .g b { color: var(--green); } .dbscale .o b { color: var(--orange); } .dbscale .r b { color: var(--red); }

/* ---------- Flow stepper ---------- */
.flow-card { border: 1.5px solid var(--blue); background: rgba(255, 255, 255, 0.5); padding: 12px 16px; min-height: 9.5rem; text-align: left; }
.flow-card h3 { margin-top: 0; }
.flow-card ul { margin: 6px 0 0; padding-left: 1.2em; font-size: 0.95rem; }
.flow-card li { margin: 3px 0; }
.flow-card p { margin: 0 0 6px; font-size: 0.95rem; }
.flow-nav { display: flex; gap: 10px; margin-top: 10px; flex-wrap: wrap; align-items: center; }

/* ---------- Ear ---------- */
svg.ear { width: 100%; max-height: min(56vh, 540px); background: #fbf9f3; border: 1px solid rgba(68, 64, 61, 0.3); }
svg.ear text { font-family: "Source Serif 4", Georgia, serif; fill: #44403d; }
svg.ear .cap { font-size: 17px; font-weight: 800; }
svg.ear .tag { font-size: 12.5px; font-style: italic; }
svg.ear .bone { fill: #efe9d9; }
svg.ear .hit { fill: rgba(0, 0, 0, 0.001); }
svg.ear .part { cursor: pointer; }
svg.ear .shape { fill: #e9e3d3; stroke: #44403d; stroke-width: 2.4; stroke-linejoin: round; transition: fill 0.2s; }
svg.ear .cavity { fill: #fbf9f3; }
svg.ear .bonepart { fill: #d9d2bf; }
svg.ear .fold, svg.ear .drum, svg.ear .ring, svg.ear .window { fill: none; stroke: #44403d; stroke-width: 2.2; stroke-linecap: round; }
svg.ear .drum { stroke-width: 4.5; }
svg.ear .tube-o { fill: none; stroke: #44403d; stroke-width: 12; }
svg.ear .tube-f { fill: none; stroke: #e9e3d3; stroke-width: 8; transition: stroke 0.2s; }
svg.ear .nerve-o { fill: none; stroke: #44403d; stroke-width: 11; stroke-linecap: round; }
svg.ear .nerve-f { fill: none; stroke: #e6d79b; stroke-width: 7; stroke-linecap: round; }
svg.ear .lead { fill: none; stroke: #44403d; stroke-width: 1; opacity: 0.55; }
svg.ear .part:hover .shape { fill: rgba(47, 103, 152, 0.16); }
svg.ear .part:hover .tube-f { stroke: #d3dfeb; }
svg.ear .part.sel .shape { fill: rgba(47, 103, 152, 0.3); stroke: var(--blue); }
svg.ear .part.sel .cavity { fill: rgba(47, 103, 152, 0.1); }
svg.ear .part.sel .bonepart { fill: rgba(47, 103, 152, 0.5); }
svg.ear .part.sel .tube-f { stroke: #b4cbe0; }
svg.ear .part.sel .tube-o, svg.ear .part.sel .fold, svg.ear .part.sel .drum, svg.ear .part.sel .ring, svg.ear .part.sel .window { stroke: var(--blue); }
svg.ear .part.sel .cap { fill: var(--blue); }
.infobox { border-left: 3px solid var(--blue); padding: 4px 0 4px 14px; margin: 10px 0; min-height: 5.2rem; }

/* ---------- Results ---------- */
.score { font-size: 3rem; font-weight: 800; color: var(--blue); line-height: 1; margin: 4px 0 10px; }
.score.fail { color: var(--orange); }
.review-list { list-style: none; padding: 0; margin: 10px 0; display: flex; flex-direction: column; gap: 8px; }
.review-list li { border: 1.5px solid rgba(68, 64, 61, 0.3); padding: 8px 12px; background: rgba(255, 255, 255, 0.4); font-size: 0.95rem; }
.survey label { display: block; margin: 10px 0 4px; font-weight: 600; }
.survey .rate { display: flex; gap: 8px; flex-wrap: wrap; }
.survey .rate label { margin: 0; font-weight: 400; display: flex; gap: 4px; align-items: center; border: 1.5px solid rgba(68, 64, 61, 0.35); padding: 4px 12px; cursor: pointer; }
.survey textarea { width: 100%; min-height: 80px; font: inherit; font-size: 0.95rem; padding: 8px; background: var(--card); color: var(--ink); border: 1.5px solid rgba(68, 64, 61, 0.45); }

/* ---------- Bottom bar ---------- */
.bar { position: fixed; left: 0; right: 0; bottom: 0; height: var(--bar-h); display: flex; align-items: center; gap: 12px; padding: 0 16px; background: var(--bg); border-top: 1px solid rgba(68, 64, 61, 0.25); font-size: 0.9rem; z-index: 5; }
.exit { color: var(--blue); text-decoration: none; white-space: nowrap; }
.exit:hover { text-decoration: underline; }
.progress { flex: 1; height: 4px; background: rgba(68, 64, 61, 0.2); }
.progress span { display: block; height: 100%; width: 0; background: var(--blue); transition: width 0.3s ease; }
.count { opacity: 0.8; min-width: 3.5em; text-align: right; font-variant-numeric: tabular-nums; }
.bar button { font: inherit; padding: 7px 18px; background: transparent; color: var(--ink); border: 1.5px solid var(--ink); cursor: pointer; }
.bar button.menu { padding: 7px 12px; border-color: rgba(68, 64, 61, 0.5); }
.bar button:hover:not(:disabled) { border-color: var(--blue); color: var(--blue); }
.bar button.primary { background: var(--blue); border-color: var(--blue); color: #fff; }
.bar button.primary:hover:not(:disabled) { background: #245682; color: #fff; }
.bar button:disabled { opacity: 0.35; cursor: default; }

dialog { width: min(560px, calc(100vw - 32px)); max-height: 82vh; padding: 20px 22px; background: var(--bg); color: var(--ink); border: 1.5px solid var(--ink); font-family: inherit; font-size: 0.95rem; line-height: 1.5; }
dialog::backdrop { background: rgba(30, 28, 26, 0.55); }
dialog h2 { font-size: 1.3rem; }
dialog h3 { margin: 12px 0 4px; }
dialog ul { padding-left: 1.2em; margin: 4px 0 10px; }
#toc-list { list-style: none; margin: 0 0 16px; padding: 0; }
#toc-list button { width: 100%; display: flex; justify-content: space-between; gap: 14px; text-align: left; font: inherit; padding: 10px 12px; background: transparent; color: var(--ink); border: 0; border-bottom: 1px solid rgba(68, 64, 61, 0.2); cursor: pointer; }
#toc-list button:hover { background: rgba(47, 103, 152, 0.1); }
#toc-list button[aria-current] { font-weight: 800; border-left: 4px solid var(--blue); }
.toc-meta { font-size: 0.8rem; font-style: italic; white-space: nowrap; }

a:focus-visible, button:focus-visible, select:focus-visible, textarea:focus-visible, summary:focus-visible, [tabindex]:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; }
.nojs { padding: 24px; }

/* ---------- Cover / closing extras ---------- */
.full .byline { font-size: 1.2rem; margin-bottom: 24px; }
.full .meta { font-size: 0.85rem; letter-spacing: 0.08em; text-transform: uppercase; margin-top: 18px; opacity: 0.9; }
.next-actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin: 14px 0 6px; }
.full .choice { color: #fff; background: transparent; border-color: #fff; display: inline-block; text-decoration: none; }
.full .choice:hover { background: rgba(255, 255, 255, 0.15); }
.link-light { font: inherit; background: none; border: 0; color: #fff; text-decoration: underline; cursor: pointer; padding: 0; }
.full a { color: #fff; }

/* ---------- Phones ---------- */
@media (max-width: 900px) {
  .path li > span { padding: 2px 6px; font-size: 0.65rem; }
  .modline { display: none; }
  .topbar { justify-content: center; }
}
@media (max-width: 760px) {
  body { font-size: 17px; }
  .split { grid-template-columns: 1fr; grid-template-rows: 30vh auto; }
  .split.img-right .media { order: 0; }
  .media { min-height: 0; }
  .text { padding: 26px 22px 34px; justify-content: flex-start; }
  .exit { display: none; }
    .path { gap: 3px; }
  .path li > span { padding: 2px 5px; font-size: 0.6rem; }
  .demo canvas { height: 150px; }
  .demo canvas.tall { height: 220px; }
}
@media (pointer: coarse), (max-width: 760px) {
  .pill, .seg button, .choice, .bar button, .link  { min-height: 44px; }
  .order button { width: 44px; height: 44px; }
  .ctrls input[type="range"] { min-height: 44px; }
  .ctrls label { min-height: 44px; }
  .match select { min-height: 44px; }
  .full .next-actions .choice { min-height: 44px; display: inline-flex; align-items: center; }
}
@media (prefers-reduced-motion: reduce) {
  .slide { animation: none; }
  .progress span { transition: none; }
}

/* ---------- Additional components ---------- */
.cols2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 24px; }
.takeaways { padding-left: 1.3em; margin: 6px 0 12px; }
.takeaways li { margin: 6px 0; }
.recap { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 10px; margin: 10px 0; text-align: left; }
.recap .card h3 { margin-top: 0; }
details.step { border: 1.5px solid rgba(68, 64, 61, 0.3); background: rgba(255, 255, 255, 0.4); margin: 8px 0; text-align: left; }
details.step summary { cursor: pointer; padding: 10px 14px; font-weight: 800; color: var(--blue); }
details.step p { margin: 0; padding: 0 14px 12px; font-size: 0.92rem; }
.flows h3 { margin-top: 0; }
.map-card { min-height: 8.2rem; display: grid; grid-template-columns: 92px 1fr; gap: 18px; align-items: center; padding: 14px 18px; background: linear-gradient(rgba(255, 255, 255, 0.7), rgba(255, 255, 255, 0.4)); box-shadow: 0 3px 0 rgba(47, 103, 152, 0.35); }
.map-card.swap .mc-body, .map-card.swap .mc-icon { animation: mc-in 0.22s ease-out; }
@keyframes mc-in { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: none; } }
.mc-icon { width: 92px; height: 92px; border-radius: 50%; display: grid; place-items: center; background: radial-gradient(circle at 35% 30%, #fffdf8, #e9e3d4); border: 2px solid var(--blue); box-shadow: 0 3px 0 rgba(47, 103, 152, 0.4), inset 0 0 0 5px rgba(47, 103, 152, 0.08); }
.mc-icon.air { border-color: var(--orange); box-shadow: 0 3px 0 rgba(168, 90, 20, 0.4), inset 0 0 0 5px rgba(168, 90, 20, 0.08); }
.mc-icon.digital { border-color: var(--green); box-shadow: 0 3px 0 rgba(74, 122, 53, 0.4), inset 0 0 0 5px rgba(74, 122, 53, 0.08); }
.demo .mc-icon canvas, .mc-icon canvas { width: 76px; height: 76px; background: none; border: 0; display: block; }
.mc-eyebrow { font-size: 0.68rem; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--blue); }
.map-card h3 { margin: 2px 0 4px; font-size: 1.5rem; letter-spacing: 0; text-transform: none; color: var(--ink); }
.map-card .mc-body p { font-size: 1.02rem; margin: 0 0 10px; }
.mc-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.chip { display: inline-flex; align-items: center; gap: 7px; padding: 3px 12px; border: 1.5px solid rgba(68, 64, 61, 0.35); border-radius: 999px; font-size: 0.82rem; background: rgba(255, 255, 255, 0.55); }
.chip i { width: 10px; height: 10px; border-radius: 50%; background: var(--blue); }
.chip.sig.air i { background: var(--orange); } .chip.sig.digital i { background: var(--green); }
@media (max-width: 560px) { .map-card { grid-template-columns: 1fr; justify-items: start; } .mc-icon { width: 72px; height: 72px; } .mc-icon canvas { width: 60px; height: 60px; } }
@media (prefers-reduced-motion: reduce) { .map-card.swap .mc-body, .map-card.swap .mc-icon { animation: none; } }
.demo .infobox { margin: 8px 0; }
@media (max-width: 760px) { .cols2 { grid-template-columns: 1fr; } }

/* ---------- Phone fixes ---------- */
table.data { display: block; max-width: 100%; overflow-x: auto; }
.survey .rate input { width: 22px; height: 22px; }
@media (max-width: 760px) {
  .match, .match tbody, .match tr, .match td { display: block; width: 100%; }
  .match td { border-bottom: 0; padding: 4px 0; }
  .match tr { padding: 8px 0; border-bottom: 1px solid rgba(68, 64, 61, 0.2); }
  .match select { width: 100%; }
  .survey .rate label { min-height: 44px; }
  .full .meta a, .link-light { display: inline-block; padding: 12px 6px; }
}

/* ---------- Transport-style play button ---------- */
.transport { width: 52px; height: 52px; padding: 0; display: inline-grid; place-items: center; flex: none; cursor: pointer; color: var(--ink);
  background: linear-gradient(#fdfbf6, #e5dfd0); border: 1.5px solid var(--ink); border-radius: var(--r);
  box-shadow: 0 2px 0 rgba(68, 64, 61, 0.55), inset 0 1px 0 #fff; transition: transform 0.08s, box-shadow 0.08s; }
.transport svg { width: 26px; height: 26px; fill: currentColor; }
.transport:hover { border-color: var(--blue); color: var(--blue); }
.transport:active { transform: translateY(2px); box-shadow: 0 0 0 rgba(68, 64, 61, 0.55), inset 0 1px 3px rgba(68, 64, 61, 0.3); }
.transport.on { color: #fff; background: linear-gradient(#3b78ad, #2a5d8b); border-color: #22507a; box-shadow: 0 2px 0 #1b3f61, inset 0 1px 0 rgba(255, 255, 255, 0.25); }
.transport[data-mode="loading"] { cursor: progress; }
.transport .spin { animation: spin 0.9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .transport .spin { animation: none; } .transport { transition: none; } }

/* ---------- Keys: every button shares the transport-key look ---------- */
.pill, .seg button, .choice, .bar button, .order button {
  background: linear-gradient(#fdfbf6, #e5dfd0);
  border: 1.5px solid var(--ink);
  border-radius: 8px;
  box-shadow: 0 2px 0 rgba(68, 64, 61, 0.55), inset 0 1px 0 #fff;
  transition: transform 0.08s, box-shadow 0.08s, background 0.15s;
}
.order button { border-radius: 50%; border-color: rgba(68, 64, 61, 0.7); }
.seg button { border-radius: 0; }
.seg button:first-child { border-radius: 8px 0 0 8px; }
.seg button:last-child { border-radius: 0 8px 8px 0; }
.seg button:only-child { border-radius: 8px; }
.pill:active:not(:disabled), .seg button:active, .choice:active:not(:disabled), .bar button:active:not(:disabled), .order button:active:not(:disabled) {
  transform: translateY(2px);
  box-shadow: 0 0 0 rgba(68, 64, 61, 0.55), inset 0 1px 3px rgba(68, 64, 61, 0.3);
}
.pill:disabled, .bar button:disabled, .order button:disabled { box-shadow: none; }
/* Lit keys: on, selected, primary */
.pill.on, .seg button[aria-pressed="true"], .bar button.primary {
  background: linear-gradient(#3b78ad, #2a5d8b);
  border-color: #22507a;
  color: #fff;
  box-shadow: 0 2px 0 #1b3f61, inset 0 1px 0 rgba(255, 255, 255, 0.25);
}
.bar button.primary:hover:not(:disabled) { background: linear-gradient(#336fa3, #245682); }
.strip .mute[aria-pressed="true"] { background: linear-gradient(#c8443d, #a62d27); border-color: #8a221d; color: #fff; box-shadow: 0 2px 0 #6d1914, inset 0 1px 0 rgba(255, 255, 255, 0.25); }
/* Keys on the photo screens stay light so they read against the picture */
.full .choice, .full .next-actions .choice { color: var(--ink); background: linear-gradient(#fdfbf6, #e5dfd0); border-color: var(--ink); }
.full .choice:hover, .full .next-actions .choice:hover { color: var(--blue); border-color: var(--blue); background: linear-gradient(#fdfbf6, #e5dfd0); }
@media (prefers-reduced-motion: reduce) {
  .pill, .seg button, .choice, .bar button, .order button { transition: none; }
}

/* Stacked sliders share one grid, so labels, tracks, and readouts line up */
.ctrls.stack { flex-wrap: nowrap; gap: 18px; align-items: center; }
.slider-rows { display: grid; grid-template-columns: max-content minmax(120px, 380px) 6.5em; align-items: center; gap: 4px 14px; flex: 1 1 auto; min-width: 0; }
.slider-rows label { display: contents; }
.slider-rows input[type="range"] { width: 100%; }
.slider-rows output { min-width: 0; }
@media (max-width: 760px) {
  .ctrls.stack { flex-wrap: wrap; }
  .slider-rows { flex: 1 1 100%; grid-template-columns: max-content 1fr 5.2em; }
}

/* Direction arrows on the signal-path strip: the journey reads left to right */
.path { gap: 2px; }
.path li { gap: 2px; }
.path .arr { width: 18px; height: 18px; flex: none; color: rgba(68, 64, 61, 0.38); }
.path .seen .arr, .path .on .arr { color: var(--blue); }
@media (max-width: 900px) { .path .arr { width: 14px; height: 14px; } }
@media (max-width: 760px) { .path { gap: 0; } .path li { gap: 0; } .path .arr { width: 10px; height: 10px; } .path li > span { padding: 2px 4px; font-size: 0.58rem; } }

.path .short { display: none; }
@media (max-width: 520px) { .path .long { display: none; } .path .short { display: inline; } .topbar { padding: 0 8px; } }
@media (max-width: 400px) { .path .arr { width: 8px; height: 8px; } .path li > span { padding: 2px 3px; } }

.demo canvas.xtall { height: clamp(250px, 42vh, 350px); }
@media (max-width: 760px) { .demo canvas.xtall { height: 280px; } }

/* ---------- Safe listening: reference chips, habit cards ---------- */
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 6px 0 4px; }
.chip { display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px; }
.chip .ico svg { width: 18px; height: 18px; fill: currentColor; display: block; }
.chip small { opacity: 0.75; }
.cards.two { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 760px) {
  .cards.two { grid-template-columns: 1fr; }
}

/* ---------- Flow stepper panel ---------- */
.demo canvas.flow-canvas { height: clamp(110px, 17vh, 150px); margin-top: 4px; }
.flow-steps { display: grid; grid-template-columns: repeat(var(--n, 6), 1fr); margin: 8px 0 10px; }
.flow-steps button { justify-self: center; font: inherit; font-size: 0.82rem; padding: 6px 10px; background: linear-gradient(#fdfbf6, #e5dfd0); color: var(--ink); border: 1.5px solid var(--ink); border-radius: 999px; box-shadow: 0 2px 0 rgba(68, 64, 61, 0.55), inset 0 1px 0 #fff; cursor: pointer; white-space: nowrap; max-width: 100%; }
.flow-steps button:hover { border-color: var(--blue); color: var(--blue); }
.flow-steps button.done { border-color: var(--green); }
.flow-steps button[aria-current="step"] { background: linear-gradient(#3b78ad, #2a5d8b); border-color: #22507a; color: #fff; font-weight: 800; box-shadow: 0 2px 0 #1b3f61, inset 0 1px 0 rgba(255, 255, 255, 0.25); }
.flow-steps .short { display: none; }
.sigtag { display: inline-flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; margin: 0 0 8px; padding: 3px 12px; border-radius: 999px; background: rgba(47, 103, 152, 0.1); font-size: 0.88rem; font-style: italic; }
.sigtag span { font-style: normal; font-size: 0.66rem; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; color: var(--blue); }
@media (max-width: 900px) { .flow-steps .long { display: none; } .flow-steps .short { display: inline; } .flow-steps button { padding: 6px 7px; font-size: 0.74rem; } }
@media (max-width: 460px) { .flow-steps button { padding: 6px 4px; font-size: 0.66rem; } }
@media (pointer: coarse), (max-width: 760px) { .flow-steps button { min-height: 44px; } }

.polars figure { margin: 0; text-align: center; }
.polars figcaption { font-size: 0.92rem; margin-top: 6px; }
.demo canvas.polar { height: clamp(150px, 24vh, 200px); }

/* The cover has no signal-path strip */
body.no-top { --top-h: 0px; }
body.no-top .topbar { display: none; }


/* The map screen's example strip: the same look as the top strip (faded upcoming
   stages, green visited, blue current), on one line, sized to its container. */
.map-wrap { container-type: inline-size; margin: 14px 0 12px; }
.path.big { flex-wrap: nowrap; justify-content: center; gap: 0.12em; font-size: clamp(0.58rem, 1.7cqw, 0.98rem); }
.path.big li { gap: 0.12em; }
.path.big .arr { width: 1.45em; height: 1.45em; }
.path li > button { font: inherit; background: none; color: inherit; cursor: pointer; padding: 0.22em 0.8em; border: 0.1em solid rgba(68, 64, 61, 0.28); border-radius: 999px; white-space: nowrap; opacity: 0.55; }
.path li > button:hover { opacity: 1; border-color: var(--blue); color: var(--blue); }
.path .seen > button { opacity: 0.9; border-color: var(--green); }
.path .on > button { opacity: 1; background: var(--blue); border-color: var(--blue); color: #fff; font-weight: 800; }
@container (max-width: 520px) {
  .path.big { font-size: 2.9cqw; gap: 0; }
  .path.big li { gap: 0; }
  .path.big .arr { width: 0.8em; height: 0.8em; }
  .path li > button { padding: 0.16em 0.3em; }
  .path li > button .long { display: none; }
  .path li > button .short { display: inline; }
}
.path.big li > button { min-height: 0; }
/* Tiny chips keep a comfortable tap area */
.path li > button { position: relative; }
.path li > button::after { content: ""; position: absolute; inset: -12px -3px; }

/* The recording chain, as a header on the screens that follow the walkthrough */
.demo canvas.chain-canvas, canvas.chain-canvas { height: clamp(92px, 14vh, 120px); margin: 2px 0 8px; width: 100%; display: block; background: #fbf9f3; border: 1px solid rgba(68, 64, 61, 0.3); }
.demo canvas.chain-canvas, canvas.chain-canvas { height: clamp(84px, 12.5vh, 108px); }
.demo canvas.polar { height: clamp(120px, 19vh, 175px); }

/* Keep the controls above the fold now that these screens carry the chain header */
.demo canvas.chain-canvas, canvas.chain-canvas { height: clamp(78px, 11.5vh, 100px); }
.demo canvas.tall.adc { height: clamp(130px, 21vh, 190px); }
.demo canvas.wave { height: clamp(110px, 17vh, 150px); }

/* Hard-stop note: appears above the Next button when it is pressed too early */
.gate-pop { position: fixed; right: 16px; bottom: calc(var(--bar-h) + 12px); z-index: 6; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; max-width: min(440px, calc(100vw - 32px)); padding: 8px 16px; border-radius: 14px; background: #f1e3d2; border: 1.5px solid rgba(168, 90, 20, 0.55); box-shadow: 0 4px 14px rgba(68, 64, 61, 0.22); font-size: 0.92rem; animation: pop-in 0.18s ease-out; }
.gate-pop[hidden] { display: none; }
.gate-pop::after { content: ""; position: absolute; right: 30px; bottom: -8px; width: 12px; height: 12px; background: #f1e3d2; border-right: 1.5px solid rgba(168, 90, 20, 0.55); border-bottom: 1.5px solid rgba(168, 90, 20, 0.55); transform: rotate(45deg); }
.gate-pop span { font-size: 0.66rem; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; color: var(--orange); }
.gate-pop b { font-variant-numeric: tabular-nums; }
@keyframes pop-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .gate-pop { animation: none; } }
/* Next while the screen's requirements are not met: dimmed, but still clickable */
.bar button.held, .bar button.held:hover, .bar button.held:active { opacity: 0.45; transform: none; box-shadow: none; cursor: pointer; }
.bar button.primary.held:hover { background: linear-gradient(#3b78ad, #2a5d8b); color: #fff; border-color: #22507a; }
#toc-list button:disabled { opacity: 0.45; cursor: not-allowed; }

/* ---------- Mixer: a DAW-style console, in the course palette ---------- */
.daw { background: var(--bg-deep); border: 1.5px solid rgba(68, 64, 61, 0.4); border-radius: 10px; padding: 8px 8px 10px; box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.55); text-align: left; }
.daw-bar { display: flex; align-items: center; gap: 10px; padding: 2px 4px 8px; }
.daw-bar .transport { width: 44px; height: 44px; }
.daw-title { margin-left: auto; font-size: 0.68rem; font-weight: 600; letter-spacing: 0.16em; text-transform: uppercase; color: var(--blue); }
.mixer { display: flex; gap: 2px; overflow-x: auto; padding-bottom: 4px; justify-content: center; }
.chan { flex: 0 0 92px; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 8px 6px 0; background: linear-gradient(#f7f3e9, #ebe6d8); border: 1px solid rgba(68, 64, 61, 0.3); }
.chan.master { flex-basis: 110px; margin-left: 8px; background: linear-gradient(#efeadd, #ddd7c7); }
.chan.silenced .faderbox { opacity: 0.5; }
.slot { width: 100%; height: 24px; font: inherit; font-size: 0.62rem; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink); background: linear-gradient(#fdfbf6, #e5dfd0); border: 1.5px solid var(--ink); border-radius: 5px; box-shadow: 0 2px 0 rgba(68, 64, 61, 0.55), inset 0 1px 0 #fff; cursor: pointer; padding: 0 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.slot:hover { border-color: var(--blue); color: var(--blue); }
.slot:active { transform: translateY(2px); box-shadow: inset 0 1px 3px rgba(68, 64, 61, 0.3); }
.slot.on { background: linear-gradient(#3b78ad, #2a5d8b); border-color: #22507a; color: #fff; box-shadow: 0 2px 0 #1b3f61, inset 0 1px 0 rgba(255, 255, 255, 0.25); }
.slot.empty { border-style: dashed; border-color: rgba(68, 64, 61, 0.25); background: transparent; box-shadow: none; cursor: default; }
.knob { position: relative; width: 36px; height: 36px; border-radius: 50%; flex: none; cursor: ns-resize; touch-action: none; background: radial-gradient(circle at 35% 28%, #ffffff, #ece7da 55%, #cfc9ba); border: 1.5px solid var(--ink); box-shadow: 0 2px 0 rgba(68, 64, 61, 0.55), inset 0 1px 0 #fff; }
.knob i { position: absolute; left: 50%; top: 4px; width: 3px; height: 13px; margin-left: -1.5px; border-radius: 2px; background: var(--blue); transform-origin: 50% 14px; transform: rotate(var(--rot, 0deg)); }
.knob-gap { height: 36px; }
.lcd { width: 100%; min-height: 21px; text-align: center; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 0.74rem; line-height: 19px; background: var(--card); color: var(--ink); border: 1px solid rgba(68, 64, 61, 0.35); border-radius: 3px; box-shadow: inset 0 1px 3px rgba(68, 64, 61, 0.25); font-variant-numeric: tabular-nums; }
.faderbox { position: relative; display: flex; align-items: stretch; justify-content: center; gap: 5px; height: clamp(120px, 21vh, 160px); width: 100%; }
.scale { position: relative; width: 20px; flex: none; }
.scale span { position: absolute; right: 0; transform: translateY(-50%); font-size: 0.56rem; color: rgba(68, 64, 61, 0.75); font-variant-numeric: tabular-nums; }
.demo .daw canvas.smeter { width: 12px; height: 100%; flex: none; background: var(--card); border: 1px solid rgba(68, 64, 61, 0.35); border-radius: 2px; display: block; }
.fader { position: relative; width: 34px; flex: none; cursor: ns-resize; touch-action: none; }
.fader .groove { position: absolute; left: 50%; top: 0; bottom: 0; width: 5px; margin-left: -2.5px; background: linear-gradient(90deg, #8c867b, #b9b3a6); border-radius: 3px; box-shadow: inset 0 0 0 1px rgba(68, 64, 61, 0.55); }
.fader .cap { position: absolute; left: 2px; width: 30px; height: 22px; margin-top: -11px; border-radius: 4px; background: linear-gradient(#fdfbf6, #e5dfd0); border: 1.5px solid var(--ink); box-shadow: 0 2px 0 rgba(68, 64, 61, 0.55), inset 0 1px 0 #fff; }
.fader .cap::after { content: ""; position: absolute; left: 3px; right: 3px; top: 50%; height: 2px; margin-top: -1px; background: var(--ink); }
.fader:focus-visible, .knob:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; }
.ms { display: flex; gap: 4px; min-height: 26px; }
.ms button { width: 30px; height: 24px; font: inherit; font-size: 0.72rem; font-weight: 800; color: var(--ink); background: linear-gradient(#fdfbf6, #e5dfd0); border: 1.5px solid var(--ink); border-radius: 5px; cursor: pointer; box-shadow: 0 2px 0 rgba(68, 64, 61, 0.55), inset 0 1px 0 #fff; }
.ms button:hover { border-color: var(--blue); color: var(--blue); }
.ms button:active { transform: translateY(2px); box-shadow: inset 0 1px 3px rgba(68, 64, 61, 0.3); }
.ms .mute[aria-pressed="true"] { background: linear-gradient(#c8443d, #a62d27); border-color: #8a221d; color: #fff; box-shadow: 0 2px 0 #6d1914, inset 0 1px 0 rgba(255, 255, 255, 0.25); }
.ms .solo[aria-pressed="true"] { background: linear-gradient(#d28a3a, #a85a14); border-color: #8a4a10; color: #fff; box-shadow: 0 2px 0 #6b390c, inset 0 1px 0 rgba(255, 255, 255, 0.25); }
.cname { width: calc(100% + 12px); margin: 0 -6px; text-align: center; padding: 5px 4px; font-weight: 800; font-size: 0.8rem; color: #fff; background: var(--tint); border-top: 1px solid rgba(68, 64, 61, 0.3); }
.demo .daw canvas.spectrum { margin-top: 8px; width: 100%; height: clamp(70px, 11vh, 110px); display: block; border: 1px solid rgba(68, 64, 61, 0.35); border-radius: 4px; background: var(--card); }
@media (max-width: 760px) {
  .mixer { justify-content: flex-start; }
  .chan { flex-basis: 80px; }
  .chan.master { flex-basis: 92px; }
  .scale { width: 16px; }
  .fader { width: 30px; }
  .fader .cap { width: 26px; }
  .ms button { width: 34px; height: 34px; }
  .slot { height: 34px; }
}

/* Frequency screen: the instrument-range scale */
.demo canvas.scale { height: clamp(250px, 38vh, 330px); cursor: ew-resize; touch-action: none; }

/* Decibel comparison bars */
.dbbars { display: grid; gap: 8px; margin: 10px 0 4px; }
.dbrow { display: grid; grid-template-columns: 9.5em 1fr 3.6em; align-items: center; gap: 12px; }
.dbname { display: flex; flex-direction: column; line-height: 1.2; }
.dbname span { font-size: 0.78rem; opacity: 0.75; }
.dbtrack { position: relative; height: 18px; background: rgba(68, 64, 61, 0.1); border-radius: 9px; overflow: hidden; }
.dbfill { height: 100%; border-radius: 9px; transition: width 0.35s ease; }
.dbval { font-weight: 800; font-variant-numeric: tabular-nums; }
@media (max-width: 560px) { .dbrow { grid-template-columns: 1fr 3.4em; } .dbname { grid-column: 1 / -1; flex-direction: row; gap: 8px; align-items: baseline; } }
@media (prefers-reduced-motion: reduce) { .dbfill { transition: none; } }
.demo canvas.dbwave { height: 200px; }
.dbmax { position: absolute; right: 8px; top: 0; line-height: 18px; font-size: 0.72rem; font-style: normal; opacity: 0.6; }

/* Microphone types: three cross-section cards */
.mictypes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.mictypes .card { padding: 8px 12px 10px; }
.mictypes .card h3 { margin: 4px 0 2px; }
.mictypes .card ul { margin: 6px 0 0; padding-left: 1.1em; font-size: 0.86rem; line-height: 1.4; }
.mt-canvas { display: block; width: 100%; height: 150px; }
.pt { font-weight: 700; }
.pt.blue { color: var(--blue); } .pt.orange { color: var(--orange); } .pt.green { color: var(--green); } .pt.gray { color: rgba(68, 64, 61, 0.8); }
@media (max-width: 760px) { .mictypes { grid-template-columns: 1fr; } }

/* Pickup patterns: three animated plots */
.polars3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 12px; }
.polars3 figure { margin: 0; text-align: center; }
.demo .polars3 canvas.polar { height: clamp(190px, 29vh, 230px); cursor: grab; touch-action: none; }
/* Each caption reads in three tiers: the name, what the pattern does, then a labeled common use.
   Subgrid keeps the tiers lined up across the three plots. */
.polars3 figure { display: grid; grid-row: span 5; grid-template-rows: subgrid; row-gap: 4px; }
.polars3 figcaption { display: contents; }
.polars3 figcaption b { margin-top: 8px; font-size: 1.05rem; color: var(--blue); }
.polars3 figcaption span { font-size: 0.92rem; line-height: 1.35; }
.polars3 figcaption em { align-self: start; margin-top: 4px; padding-top: 7px; border-top: 1px solid rgba(68, 64, 61, 0.22); font-size: 0.84rem; font-style: normal; line-height: 1.35; opacity: 0.85; }
.polars3 figcaption em::before { content: "Common use"; display: block; margin-bottom: 2px; font-size: 0.64rem; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--blue); opacity: 0.85; }
@media (max-width: 760px) { .polars3 { grid-template-columns: 1fr; gap: 14px 0; } .polars3 figure { grid-row: auto; display: block; } .polars3 figcaption { display: flex; flex-direction: column; gap: 4px; } }

/* Gain staging: fader, vertical meter and waveform on one console panel */
.gainrig { display: flex; gap: 14px; align-items: flex-start; margin: 10px 0 6px; padding: 12px 14px; border: 1.5px solid rgba(68, 64, 61, 0.3); background: rgba(255, 255, 255, 0.4); }
.gr-strip { display: flex; flex-direction: column; align-items: center; gap: 8px; width: 214px; flex: none; }
.gr-strip .faderbox { height: 200px; }
.gr-strip .lcd { width: 96px; }
.gr-label { font-size: 0.7rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--blue); font-weight: 700; }
.demo .gainrig canvas.smeter { width: 12px; height: 100%; flex: none; background: var(--card); border: 1px solid rgba(68, 64, 61, 0.35); border-radius: 2px; display: block; }
.gainrig .zones { position: relative; width: 50px; flex: none; }
.gainrig .z { position: absolute; left: 0; right: 0; display: flex; align-items: center; padding-left: 7px; font-size: 0.7rem; font-weight: 700; border-left: 3px solid currentColor; }
.gainrig .z.gray { color: #6b645d; } .gainrig .z.green { color: var(--green); } .gainrig .z.red { color: var(--red); }
.gr-wavecol { flex: 1 1 260px; min-width: 0; position: relative; }
.demo .gainrig canvas.wave { height: 200px; background: rgba(250, 249, 245, 0.9); border: 1px solid rgba(68, 64, 61, 0.25); }
.gainrig .lcd[data-state="good"] { color: var(--green); } .gainrig .lcd[data-state="ok"] { color: var(--orange); } .gainrig .lcd[data-state="clip"] { color: var(--red); font-weight: 700; }
@media (max-width: 560px) { .gainrig { flex-wrap: wrap; } .gr-wavecol { flex-basis: 100%; } }
.demo canvas.adc { height: clamp(190px, 34vh, 300px); }

/* Stepped controls on the converter slide: labeled stops, a fill that runs outward from the default, and a preview grid */
.steppers { display: grid; gap: 6px; margin: 4px 0 8px; }
.stepper { display: grid; grid-template-columns: 7.2em minmax(160px, 1fr) 76px 9em; align-items: center; gap: 4px 16px; }
.st-label { font-weight: 600; }
.st-track { --thumb: 24px; position: relative; height: 46px; }
.st-bar { position: absolute; left: 0; right: 0; top: 13px; height: 8px; margin-top: -4px; border-radius: 4px; background: #d9d3c4; box-shadow: inset 0 0 0 1px rgba(68, 64, 61, 0.45); }
.st-fill { position: absolute; top: 13px; height: 8px; margin-top: -4px; border-radius: 4px; left: calc(var(--thumb) / 2 + (100% - var(--thumb)) * var(--fa, 0)); width: calc((100% - var(--thumb)) * (var(--fb, 0) - var(--fa, 0))); background: transparent; transition: left 0.15s, width 0.15s; }
.stepper.less .st-fill { background: var(--orange); } .stepper.more .st-fill { background: var(--blue); }
.st-ticks span { position: absolute; left: calc(var(--thumb) / 2 + (100% - var(--thumb)) * var(--p)); top: 30px; transform: translateX(-50%); font-size: 0.78rem; color: rgba(68, 64, 61, 0.7); font-variant-numeric: tabular-nums; white-space: nowrap; }
.st-ticks span::before { content: ""; position: absolute; left: 50%; top: -14px; width: 2px; height: 8px; margin-left: -1px; background: rgba(68, 64, 61, 0.55); }
.st-ticks span.on { color: var(--ink); font-weight: 800; }
.stepper input[type="range"] { position: absolute; left: 0; top: 0; width: 100%; height: 26px; margin: 0; background: transparent; -webkit-appearance: none; appearance: none; cursor: pointer; }
.stepper input[type="range"]::-webkit-slider-runnable-track { height: 26px; background: transparent; }
.stepper input[type="range"]::-moz-range-track { height: 26px; background: transparent; }
.stepper input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: var(--thumb); height: var(--thumb); margin-top: 1px; border-radius: 50%; background: linear-gradient(#fdfbf6, #e5dfd0); border: 1.5px solid var(--ink); box-shadow: 0 2px 0 rgba(68, 64, 61, 0.55), inset 0 1px 0 #fff; }
.stepper input[type="range"]::-moz-range-thumb { width: calc(var(--thumb) - 3px); height: calc(var(--thumb) - 3px); border-radius: 50%; background: linear-gradient(#fdfbf6, #e5dfd0); border: 1.5px solid var(--ink); box-shadow: 0 2px 0 rgba(68, 64, 61, 0.55), inset 0 1px 0 #fff; }
.stepper input[type="range"]:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; border-radius: 4px; }
.stepper.bump input[type="range"]::-webkit-slider-thumb { animation: thumb-bump 0.18s ease-out; }
@keyframes thumb-bump { 0% { transform: scale(1.25); } 100% { transform: scale(1); } }
.demo .stepper canvas.st-grid { width: 76px; height: 46px; background: var(--card); border: 1px solid rgba(68, 64, 61, 0.35); border-radius: 3px; }
.stepper output { font-weight: 800; }
@media (max-width: 640px) { .stepper { grid-template-columns: 1fr 76px; } .st-label { grid-column: 1 / -1; } .stepper output { grid-column: 1 / -1; } }
@media (prefers-reduced-motion: reduce) { .st-fill { transition: none; } .stepper.bump input[type="range"]::-webkit-slider-thumb { animation: none; } }

/* Connector lines from the root card down to its branches (slide 26) */
.dist-fork { width: 100%; height: 26px; display: block; }
.dist-fork path { fill: none; stroke: var(--ink); stroke-width: 2; stroke-dasharray: 5 4; vector-effect: non-scaling-stroke; animation: dist-flow 1s linear infinite; }
@keyframes dist-flow { to { stroke-dashoffset: -9; } }
@media (prefers-reduced-motion: reduce) { .dist-fork path { animation: none; } }

/* ---------------------------------------------------------------------------
   One corner radius across the course: the same rounding as the buttons.
   Small pills (the signal-path strip, tags) keep their full rounding.
   --------------------------------------------------------------------------- */
.card, .flow-card, .map-card, .warnbox, .review-list li, details.step, .order li,
.survey textarea, .survey .rate label, .match select, .gainrig, .daw,
.gate-pop, dialog, svg.ear, .demo canvas, .choice { border-radius: var(--r); }
details.step { overflow: hidden; }
/* boxes marked by a bar on the left: give them a faint fill so the rounded corners show */
.callout, .infobox { border-radius: 0 var(--r) var(--r) 0; background: rgba(47, 103, 152, 0.07); padding-right: 14px; }
.callout { padding-top: 8px; padding-bottom: 8px; }
.demo .gainrig canvas.wave, .demo .daw canvas.spectrum { border-radius: 4px; }
.demo canvas.smeter, .demo .gainrig canvas.smeter, .demo .daw canvas.smeter { border-radius: 2px; }
.demo .mc-icon canvas { border-radius: 0; }
.demo .stepper canvas.st-grid { border-radius: 6px; }
.demo canvas.chain-canvas, canvas.chain-canvas { border-radius: var(--r); }
.chan { border-radius: var(--r); }
.cname { border-radius: 0 0 calc(var(--r) - 2px) calc(var(--r) - 2px); }

/* Level-change fader on the amplitude slide: the gain console again, with three detents */
.dbrig .gr-strip { width: 120px; }
.dbrig .faderbox { height: 200px; }
.fader .detent { position: absolute; left: 50%; width: 18px; height: 2px; margin: -1px 0 0 -9px; background: rgba(68, 64, 61, 0.7); }
.dbrig .fader .cap { transition: top 0.12s ease-out; }
.fader .cap.bump { animation: cap-bump 0.16s ease-out; }
@keyframes cap-bump { 0% { transform: scale(1.12); } 100% { transform: scale(1); } }
.demo .dbrig canvas.dbwave { height: 200px; background: rgba(250, 249, 245, 0.9); border: 1px solid rgba(68, 64, 61, 0.25); border-radius: 4px; }
@media (prefers-reduced-motion: reduce) { .dbrig .fader .cap { transition: none; } .fader .cap.bump { animation: none; } }

/* Dragging a fader or knob with the mouse or a finger should not draw the keyboard focus ring; the keyboard still gets it. */
.fader.pointer-focus:focus-visible, .knob.pointer-focus:focus-visible { outline: none; }

/* Oscillator console: frequency and amplitude faders beside a scope-style display */
.wr-strips { display: flex; gap: 14px; flex: none; }
.waverig .gr-strip { width: 96px; }
.waverig .faderbox { height: 200px; }
.demo .waverig canvas.wave { height: 232px; background: rgba(250, 249, 245, 0.9); border: 1px solid rgba(68, 64, 61, 0.25); border-radius: 4px; }
.waverig .gr-wavecol { align-self: stretch; }
@media (max-width: 560px) { .wr-strips { width: 100%; justify-content: space-around; } }

/* Frequency and amplitude knobs, stacked beside the scope */
.waverig .wr-strips { flex-direction: column; gap: 10px; }
.wr-unit { display: flex; flex-direction: column; align-items: center; gap: 2px; width: 124px; }
.wr-unit .gr-label { margin-top: 0; }
.wr-unit .lcd { width: 92px; }
.demo canvas.knobdial { width: 124px; height: 92px; background: none; border: 0; cursor: ns-resize; touch-action: none; border-radius: var(--r); }
.demo canvas.knobdial:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; }
.demo canvas.knobdial.pointer-focus:focus-visible { outline: none; }
.demo .waverig canvas.wave { height: 270px; }

/* The play key lives in the oscillator's own header bar, like the mixer's transport */
.waverig { flex-direction: column; align-items: stretch; gap: 0; }
.wr-head { display: flex; align-items: center; gap: 12px; padding: 0 0 10px; margin-bottom: 12px; border-bottom: 1px solid rgba(68, 64, 61, 0.22); }
.wr-head .transport { width: 40px; height: 40px; }
.wr-head .transport svg { width: 18px; height: 18px; }
.wr-title { font-size: 0.72rem; letter-spacing: 0.14em; text-transform: uppercase; font-weight: 700; color: var(--blue); }
.wr-led { width: 11px; height: 11px; border-radius: 50%; margin-left: auto; background: #b9b3a6; box-shadow: inset 0 1px 2px rgba(68, 64, 61, 0.5); }
.wr-led.on { background: var(--green); box-shadow: 0 0 0 3px rgba(74, 122, 53, 0.22), 0 0 8px rgba(74, 122, 53, 0.7); }
.wr-state { font-size: 0.82rem; min-width: 4.8em; opacity: 0.85; }
.wr-body { display: flex; gap: 14px; align-items: flex-start; flex-wrap: wrap; }
.wr-body .gr-wavecol { flex: 1 1 280px; }
@media (max-width: 560px) { .wr-body .wr-strips { width: 100%; flex-direction: row; justify-content: space-around; } }

/* The before/after graph runs the full height of the fader strip beside it (fader, readout and label) */
.dbrig .wr-body { align-items: flex-start; }
.demo .dbrig canvas.dbwave { height: 254px; }
.polars3 + .note { margin-top: 28px; }
.polars3 + .note::before { content: "Try it"; font-style: normal; font-weight: 700; font-size: 0.68rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--blue); margin-right: 10px; }
.polars3 figcaption small { align-self: start; margin-top: 2px; font-size: 0.84rem; line-height: 1.35; opacity: 0.85; }
.polars3 figcaption small::before { content: "Classic models"; display: block; margin-bottom: 2px; font-size: 0.64rem; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--blue); opacity: 0.85; }

/* Preamp gain console: the same header bar as the oscillator, with a lamp that follows the zone */
.gaincon { flex-direction: column; align-items: stretch; gap: 0; }
.gaincon .gr-strip { width: 214px; }
.demo .gaincon canvas.wave { height: 254px; }
.wr-led.low { background: #8c867b; box-shadow: inset 0 1px 2px rgba(68, 64, 61, 0.5); }
.wr-led.good { background: var(--green); box-shadow: 0 0 0 3px rgba(74, 122, 53, 0.22), 0 0 8px rgba(74, 122, 53, 0.7); }
.wr-led.ok { background: var(--orange); box-shadow: 0 0 0 3px rgba(168, 90, 20, 0.22), 0 0 8px rgba(168, 90, 20, 0.7); }
.wr-led.clip { background: var(--red); box-shadow: 0 0 0 3px rgba(179, 48, 42, 0.25), 0 0 9px rgba(179, 48, 42, 0.8); }
.wr-led.hot { background: #d4532d; box-shadow: 0 0 0 3px rgba(212, 83, 45, 0.25), 0 0 9px rgba(212, 83, 45, 0.8); }
.gainrig .lcd[data-state="hot"] { color: var(--red); font-weight: 700; }

/* The preamp's gain knob, with the level meter beside it */
.gaincon .gk-strip { width: 258px; }
.gk-row { display: flex; align-items: center; gap: 6px; width: 100%; }
.gk-meter { width: 92px !important; flex: none; }
.demo canvas.knobdial.gainknob { width: 160px; height: 200px; }

/* The gain knob stands alone now; the zones are drawn around its edge */
.gaincon .gk-strip { width: 226px; }
.demo canvas.knobdial.gainknob { width: 226px; height: 168px; }
.demo .gaincon canvas.wave { height: 222px; }

/* Mastering and digital release: format cards and the loudness comparison */
.relcards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 6px 0 14px; }
.relcard { padding: 12px 14px 12px; border: 1.5px solid rgba(68, 64, 61, 0.3); border-top: 4px solid var(--blue); background: rgba(255, 255, 255, 0.5); box-shadow: 0 2px 0 rgba(68, 64, 61, 0.15); }
.relcard.cd { border-top-color: var(--orange); } .relcard.stream { border-top-color: var(--green); }
.relcard svg { width: 54px; height: 36px; color: var(--blue); display: block; margin-bottom: 4px; }
.relcard.cd svg { color: var(--orange); } .relcard.stream svg { color: var(--green); }
.relcard h3 { margin: 2px 0 6px; font-size: 1.2rem; letter-spacing: 0; text-transform: none; color: var(--ink); }
.relcard dl { margin: 8px 0 0; font-size: 0.9rem; line-height: 1.35; }
.relcard dt { font-size: 0.64rem; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--blue); margin-top: 6px; }
.relcard dd { margin: 1px 0 0; }
@media (max-width: 760px) { .relcards { grid-template-columns: 1fr; } }

/* Mastering and digital release as a family tree: the studio session is the root, the formats branch from it */
.reltree { display: grid; justify-items: center; margin: 6px 0 14px; }
.relroot { width: min(100%, 520px); display: grid; grid-template-columns: auto 1fr; column-gap: 14px; align-items: start; border-radius: var(--r); }
.relroot svg { margin: 4px 0 0; }
.relroot .relroot-body h3 { margin-top: 0; }
.reltag { display: block; font-size: 0.64rem; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--blue); margin-bottom: 2px; }
.relbranches { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; width: 100%; }
.relcard.vinyl { border-top-color: #6b645d; } .relcard.vinyl svg { color: #6b645d; }
.relbranches .relcard { border-radius: var(--r); }
@media (max-width: 760px) { .relbranches { grid-template-columns: 1fr; } }
.relroot dl { display: grid; grid-template-columns: 1fr 1fr; gap: 0 18px; }
@media (max-width: 520px) { .relroot dl { grid-template-columns: 1fr; } }

.relpath { font-size: 0.84rem; }
.relpath i { font-style: normal; color: var(--blue); font-weight: 700; padding: 0 1px; }
@media (max-width: 760px) { .dist-fork { display: none; } }

/* The ear diagram: soft halos show which part is hovered or chosen */
svg.ear .halo { fill: rgba(47, 103, 152, 0); stroke: none; transition: fill 0.2s, stroke 0.2s; }
svg.ear .halo-tube { fill: none; stroke: rgba(47, 103, 152, 0); stroke-width: 46; stroke-linecap: round; transition: stroke 0.2s; }
svg.ear .part:hover .halo { fill: rgba(47, 103, 152, 0.1); }
svg.ear .part:hover .halo-tube { stroke: rgba(47, 103, 152, 0.1); }
svg.ear .part.sel .halo { fill: rgba(47, 103, 152, 0.16); stroke: var(--blue); stroke-width: 2; stroke-dasharray: 7 5; }
svg.ear .part.sel .halo-tube { stroke: rgba(47, 103, 152, 0.2); }
svg.ear .part.sel .tag { fill: var(--blue); }
svg.ear .tag { font-size: 16.5px; }
svg.ear .cap { font-size: 22px; }
svg.ear { background: #fffdf8; }

/* Ear part picker: tiles in the colors of the diagram, instead of a plain segmented button */
.eartiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 6px 0 10px; }
.eartile { --c: #cf7650; --tint: rgba(244, 164, 124, 0.22); display: flex; align-items: center; gap: 12px; text-align: left; font: inherit; color: var(--ink); padding: 10px 14px; background: rgba(255, 255, 255, 0.55); border: 1.5px solid rgba(68, 64, 61, 0.28); border-left: 6px solid var(--c); border-radius: var(--r); box-shadow: 0 2px 0 rgba(68, 64, 61, 0.18); cursor: pointer; transition: transform 0.1s, box-shadow 0.1s, background 0.15s, border-color 0.15s; }
.eartile.middle { --c: #4a7a35; --tint: rgba(143, 210, 95, 0.24); }
.eartile.inner { --c: #c85a74; --tint: rgba(240, 138, 160, 0.24); }
.eartile svg { width: 40px; height: 40px; flex: none; }
.et-text { display: flex; flex-direction: column; line-height: 1.25; }
.et-text b { font-size: 1.02rem; }
.et-text i { font-size: 0.8rem; font-style: normal; opacity: 0.75; }
.eartile:hover { transform: translateY(-2px); box-shadow: 0 4px 0 rgba(68, 64, 61, 0.2); background: var(--tint); }
.eartile:active { transform: translateY(1px); box-shadow: none; }
.eartile[aria-pressed="true"] { background: var(--tint); border-color: var(--c); box-shadow: 0 3px 0 var(--c); transform: translateY(-1px); }
.eartile[aria-pressed="true"] .et-text b { color: var(--c); }
.eartile:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; }
@media (max-width: 640px) { .eartiles { grid-template-columns: 1fr; } }
@media (prefers-reduced-motion: reduce) { .eartile { transition: none; } }

/* The cochlea slide: the same tone panel as the oscillator, with the unrolled cochlea beside the knob */
.cochrig .wr-body { align-items: center; flex-wrap: nowrap; }
.cochrig .gr-wavecol { flex: 1 1 0; min-width: 0; }
.demo .cochrig canvas.cochlea { background: rgba(250, 249, 245, 0.9); border: 1px solid rgba(68, 64, 61, 0.25); border-radius: 4px; }
@media (max-width: 760px) { .cochrig .wr-body { flex-wrap: wrap; } .cochrig .gr-wavecol { flex-basis: 100%; } }

/* Safe listening: the same tone panel, with the level knob beside the battery */
.saferig .wr-body { align-items: center; flex-wrap: nowrap; }
.saferig .wr-unit { width: 226px; }
.saferig .gr-wavecol { flex: 1 1 0; min-width: 0; }
.saferig .chips { margin: 0 0 12px; }
.demo .saferig canvas.safecv { background: rgba(250, 249, 245, 0.9); border: 1px solid rgba(68, 64, 61, 0.25); border-radius: 4px; }
@media (max-width: 760px) { .saferig .wr-body { flex-wrap: wrap; } .saferig .gr-wavecol { flex-basis: 100%; } }
.saferig .chips { display: flex; flex-wrap: wrap; justify-content: center; }

/* How we locate sound: the same sound-source panel, with the position knob beside the head diagram */
.locrig .wr-body { align-items: center; flex-wrap: nowrap; }
.locrig .gr-wavecol { flex: 1 1 0; min-width: 0; }
.loctiles { grid-template-columns: repeat(2, minmax(0, 1fr)); max-width: 620px; margin: 0 auto 12px; }
.eartile.itd { --c: var(--blue); --tint: rgba(47, 103, 152, 0.14); }
.eartile.ild { --c: var(--orange); --tint: rgba(168, 90, 20, 0.14); }
.demo .locrig canvas.loccv { background: rgba(250, 249, 245, 0.9); border: 1px solid rgba(68, 64, 61, 0.25); border-radius: 4px; cursor: pointer; }
@media (max-width: 760px) { .locrig .wr-body { flex-wrap: wrap; } .locrig .gr-wavecol { flex-basis: 100%; } .loctiles { grid-template-columns: 1fr; } }
.wr-unit .gr-label { text-align: center; }
.locrig .wr-unit { width: 150px; }

/* Drag-to-match questions */
.dm-hint { margin: 2px 0 10px; opacity: 0.85; }
.dmatch { display: grid; gap: 14px; margin: 6px 0 12px; }
.dm-rows { display: grid; gap: 10px; }
.dm-row { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1.25fr); align-items: center; gap: 12px; }
.dm-name { font-weight: 700; line-height: 1.3; }
.dm-arrow { color: var(--blue); font-weight: 800; }
.dm-slot { min-height: 52px; display: flex; align-items: center; padding: 4px; border: 2px dashed rgba(68, 64, 61, 0.4); border-radius: var(--r); background: rgba(255, 255, 255, 0.35); transition: background 0.12s, border-color 0.12s; }
.dm-slot.filled { border-style: solid; border-color: rgba(68, 64, 61, 0.35); background: rgba(255, 255, 255, 0.6); }
.dm-slot.over, .dm-pool.over { border-color: var(--blue); background: rgba(47, 103, 152, 0.12); }
.dm-slot:focus-visible, .dm-pool:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; }
.dm-ph { width: 100%; text-align: center; font-size: 0.85rem; font-style: italic; opacity: 0.6; }
.dm-pool { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; padding: 12px; border: 2px dashed rgba(47, 103, 152, 0.4); border-radius: var(--r); background: rgba(47, 103, 152, 0.05); transition: background 0.12s, border-color 0.12s; }
.dm-pool.empty { opacity: 0.55; }
.dm-poolhead { flex: 0 0 100%; font-size: 0.66rem; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--blue); }
.dm-chip { font: inherit; font-size: 0.95rem; line-height: 1.3; text-align: left; color: var(--ink); padding: 9px 14px; background: linear-gradient(#fdfbf6, #e5dfd0); border: 1.5px solid var(--ink); border-radius: var(--r); box-shadow: 0 2px 0 rgba(68, 64, 61, 0.55), inset 0 1px 0 #fff; cursor: grab; touch-action: none; user-select: none; -webkit-user-select: none; }
.dm-slot .dm-chip { width: 100%; }
.dm-chip:hover { border-color: var(--blue); }
.dm-chip.lifted { opacity: 0.3; }
.dm-chip.held { outline: 3px solid var(--blue); outline-offset: 2px; background: linear-gradient(#e9f1f8, #cfe0ef); }
.dm-chip:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; }
.dm-chip:disabled { cursor: default; opacity: 1; color: var(--ink); }
.dm-ghost { position: fixed; z-index: 50; pointer-events: none; margin: 0; cursor: grabbing; transform: rotate(-2deg); box-shadow: 0 10px 20px rgba(68, 64, 61, 0.35), inset 0 1px 0 #fff; opacity: 0.95; }
.dm-row.right .dm-slot { border: 2px solid var(--green); background: rgba(74, 122, 53, 0.1); }
.dm-row.wrong .dm-slot { border: 2px solid var(--red); background: rgba(179, 48, 42, 0.08); }
.dmatch.locked .dm-pool { display: none; }
@media (max-width: 640px) { .dm-row { grid-template-columns: 1fr; gap: 4px; } .dm-arrow { display: none; } }
@media (prefers-reduced-motion: reduce) { .dm-slot, .dm-pool { transition: none; } .dm-ghost { transform: none; } }

/* Microphone types: the same three-tier captions as the pickup patterns */
.mtypes .mt-canvas { height: 176px; }
.polars3.mtypes figcaption em::before { content: "Traits"; }
.mtypes figcaption span .pt { font-weight: 700; }
.mtypes figcaption span.pt { display: inline; }
.demo .mtypes .mt-canvas { background: transparent; border: 0; }
.demo canvas.chain-canvas, .demo canvas.flow-canvas { background: transparent; border: 0; }
canvas.chain-canvas, canvas.flow-canvas { background: transparent; border: 0; }

/* The signal-path strip across the top: round icons, dashed connectors, labels underneath */
.topbar { flex-direction: column; justify-content: center; align-items: stretch; gap: 2px; padding: 5px 16px 3px; }
.topbar .modline { text-align: center; line-height: 1; }
.ipath { list-style: none; margin: 0 auto; padding: 0; display: flex; width: 100%; max-width: 800px; }
.ipath li { position: relative; flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 3px; }
.ipath li:not(:first-child)::before { content: ""; position: absolute; top: 18px; left: calc(-50% + 20px); width: calc(100% - 40px); border-top: 2px dashed rgba(68, 64, 61, 0.28); }
.ipath li.seen::before { border-top-color: var(--green); }
.ipath li.on::before { border-top-color: var(--blue); }
.pnode { width: 36px; height: 36px; box-sizing: border-box; border-radius: 50%; display: grid; place-items: center; background: var(--card); border: 2px solid rgba(68, 64, 61, 0.35); transition: border-color 0.2s, box-shadow 0.2s, background 0.2s; }
.ipath .seen .pnode { border-color: var(--green); }
.ipath .on .pnode { border-color: var(--blue); background: #e7eff7; box-shadow: 0 0 0 4px rgba(47, 103, 152, 0.14), 0 0 12px rgba(47, 103, 152, 0.4); }
.pnode canvas { width: 25px; height: 25px; display: block; }
.plabel { font-size: 0.66rem; line-height: 16px; padding: 0 8px; border: 1.3px solid rgba(68, 64, 61, 0.4); border-radius: 999px; background: linear-gradient(#fdfbf6, #e9e3d4); box-shadow: 0 1.5px 0 rgba(68, 64, 61, 0.35); white-space: nowrap; opacity: 0.7; }
.ipath .seen .plabel { opacity: 0.95; border-color: var(--green); }
.ipath .on .plabel { opacity: 1; background: linear-gradient(#3b78ad, #2a5d8b); border-color: #22507a; color: #fff; font-weight: 800; box-shadow: 0 1.5px 0 #1b3f61; }
.ipath .short { display: none; }
@media (max-width: 760px) { :root { --top-h: 66px; } .ipath li:not(:first-child)::before { top: 14px; left: calc(-50% + 16px); width: calc(100% - 32px); } .pnode { width: 28px; height: 28px; } .pnode canvas { width: 19px; height: 19px; } .plabel { font-size: 0.58rem; padding: 0 6px; } }
@media (max-width: 520px) { .ipath .long { display: none; } .ipath .short { display: inline; } .plabel { padding: 0 5px; } .topbar { padding: 4px 6px 2px; } }
@media (prefers-reduced-motion: reduce) { .pnode { transition: none; } }
@media (max-width: 760px) { .polars3 figcaption em, .polars3 figcaption small { align-self: stretch; } }

/* The map screen's strip: the top bar's icon design, larger, with a button under each icon */
.map-path { max-width: none; width: 100%; margin: 6px 0 14px; }
.map-path li > button { font: inherit; color: inherit; background: none; border: 0; padding: 4px 0 0; display: flex; flex-direction: column; align-items: center; gap: 6px; cursor: pointer; position: relative; min-width: 0; }
.map-path li > button:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; border-radius: 10px; }
.map-path li > button::after { content: ""; position: absolute; inset: -4px -6px -4px; }
.map-path .pnode { width: 56px; height: 56px; transition: transform 0.12s, border-color 0.2s, box-shadow 0.2s, background 0.2s; }
.map-path li > button:hover .pnode { border-color: var(--blue); transform: translateY(-2px); }
.map-path .pnode canvas { width: 38px; height: 38px; }
.map-path .plabel { font-size: 0.82rem; line-height: 20px; padding: 0 12px; }
.map-path li:not(:first-child)::before { top: 32px; left: calc(-50% + 31px); width: calc(100% - 62px); border-top-width: 2.5px; }
@media (max-width: 760px) { .map-path .pnode { width: 40px; height: 40px; } .map-path .pnode canvas { width: 27px; height: 27px; } .map-path .plabel { font-size: 0.64rem; line-height: 17px; padding: 0 6px; } .map-path li:not(:first-child)::before { top: 24px; left: calc(-50% + 22px); width: calc(100% - 44px); } }
@media (max-width: 520px) { .map-path .long { display: none; } .map-path .short { display: inline; } .map-path .plabel { padding: 0 4px; } .map-path .pnode { width: 32px; height: 32px; } .map-path .pnode canvas { width: 22px; height: 22px; } .map-path li:not(:first-child)::before { top: 20px; left: calc(-50% + 18px); width: calc(100% - 36px); } }
@media (prefers-reduced-motion: reduce) { .map-path .pnode { transition: none; } }

/* Signal connectors between the icons (replacing plain dashed lines): air, small and big electrical waves, digital steps */
.ipath li:not(:first-child)::before { display: none; }
.pconn { position: absolute; top: 0; left: calc(-50% + 21px); width: calc(100% - 42px); height: 36px; pointer-events: none; }
.map-path .pconn { top: 8px; left: calc(-50% + 33px); width: calc(100% - 66px); height: 48px; }
@media (max-width: 760px) { .pconn { top: 1px; left: calc(-50% + 17px); width: calc(100% - 34px); height: 26px; } .map-path .pconn { top: 7px; left: calc(-50% + 24px); width: calc(100% - 48px); height: 34px; } }
@media (max-width: 520px) { .map-path .pconn { top: 6px; left: calc(-50% + 20px); width: calc(100% - 40px); height: 28px; } }
.demo .mtypes { margin-top: 26px; }

/* Mini DAW */
.dawrig .wr-head { margin-bottom: 10px; }
.reckey { width: 40px; height: 40px; padding: 0; display: inline-grid; place-items: center; cursor: pointer; background: linear-gradient(#fdfbf6, #e5dfd0); border: 1.5px solid var(--ink); border-radius: var(--r); box-shadow: 0 2px 0 rgba(68, 64, 61, 0.55), inset 0 1px 0 #fff; transition: transform 0.08s, box-shadow 0.08s; }
.reckey i { width: 16px; height: 16px; border-radius: 50%; background: #b3302a; box-shadow: inset 0 -2px 0 rgba(0, 0, 0, 0.18); }
.reckey:hover { border-color: var(--blue); }
.reckey:active { transform: translateY(2px); box-shadow: none; }
.reckey.on { background: linear-gradient(#f4d9d6, #e7b9b4); border-color: #8a221d; }
.reckey:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; }
.wr-led.rec { background: #b3302a; box-shadow: 0 0 0 3px rgba(179, 48, 42, 0.25), 0 0 9px rgba(179, 48, 42, 0.8); animation: rec-blink 1s ease-in-out infinite; }
@keyframes rec-blink { 50% { opacity: 0.55; } }
.demo .dawrig canvas.dawcv { height: clamp(210px, 33vh, 270px); background: rgba(250, 249, 245, 0.9); border: 1px solid rgba(68, 64, 61, 0.25); border-radius: 4px; touch-action: none; }
@media (prefers-reduced-motion: reduce) { .wr-led.rec { animation: none; } .reckey { transition: none; } }
.demo .dawrig canvas.dawcv:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; }

/* A small signal flow inside a stage card: numbered nodes joined by connecting lines */
.minifl { list-style: none; margin: 10px 0 4px; padding: 0; display: flex; }
.minifl li { position: relative; flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; }
.minifl li:not(:first-child)::before { content: ""; position: absolute; top: 15px; left: calc(-50% + 20px); width: calc(100% - 40px); border-top: 2.5px solid var(--green); }
.minifl li:not(:first-child)::after { content: ""; position: absolute; top: 10.5px; left: calc(50% - 25px); width: 8px; height: 8px; border-top: 2.5px solid var(--green); border-right: 2.5px solid var(--green); transform: rotate(45deg); }
.mf-node { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: 0.9rem; color: var(--blue); background: var(--card); border: 2.5px solid var(--green); box-sizing: border-box; position: relative; z-index: 1; }
.mf-label { font-size: 0.88rem; line-height: 1.25; font-weight: 600; }
.mf-label small { display: block; font-weight: 400; opacity: 0.75; font-size: 0.75rem; }
@media (max-width: 560px) { .minifl { flex-wrap: wrap; row-gap: 12px; } .minifl li { flex: 1 1 28%; } .minifl li:nth-child(4)::before, .minifl li:nth-child(4)::after { display: none; } }

.mf-node { width: 46px; height: 46px; }
.mf-node canvas { width: 30px; height: 30px; display: block; }
.minifl li:not(:first-child)::before { top: 22px; left: calc(-50% + 28px); width: calc(100% - 56px); }
.minifl li:not(:first-child)::after { top: 17.5px; left: calc(50% - 33px); }

/* Stage cards on the mix flow screen: no white box or blue border around the contents */
.flow-card.map-card { border: 0; background: none; box-shadow: none; border-radius: 0; padding: 14px 0; }

/* Stage stepper: round arrow keys with a stage counter, in place of the Previous/Next stage pills */
.stagenav { gap: 14px; }
.stepkey { width: 40px; height: 40px; padding: 0; border-radius: 50%; display: grid; place-items: center; cursor: pointer; color: var(--blue); background: var(--card); border: 2px solid var(--blue); box-shadow: 0 2px 0 rgba(47, 103, 152, 0.35); transition: transform 0.12s, box-shadow 0.12s, background 0.2s; }
.stepkey svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.stepkey:hover:not(:disabled) { background: #e7eff7; transform: translateY(-1px); }
.stepkey:active:not(:disabled) { transform: translateY(2px); box-shadow: none; }
.stepkey:disabled { cursor: default; color: rgba(68, 64, 61, 0.35); border-color: rgba(68, 64, 61, 0.25); box-shadow: none; background: transparent; }
.step-count { min-width: 6.5em; text-align: center; font-size: 0.9rem; font-weight: 600; letter-spacing: 0.04em; color: var(--ink); }
@media (prefers-reduced-motion: reduce) { .stepkey { transition: none; } }

/* Stage card and stepper centred as one group */
.map-card { grid-template-columns: auto auto; justify-content: center; width: fit-content; max-width: 100%; margin-inline: auto; }
.stagenav { justify-content: center; }
@media (max-width: 560px) { .map-card { grid-template-columns: 1fr; justify-items: center; text-align: center; } .map-card .mc-chips, .map-card .minifl { justify-content: center; } }
.flow-nav.stagenav { display: flex; justify-content: center; }

/* Stage card as one centred column: eyebrow, icon, name, description, chips (the stepper follows below) */
.map-card { display: flex; flex-direction: column; align-items: center; text-align: center; width: auto; gap: 0; }
.map-card .mc-body { display: contents; }
.map-card .mc-body > * { order: 3; }
.map-card .mc-eyebrow { order: 0; margin-bottom: 12px; }
.map-card .mc-icon { order: 1; margin-bottom: 10px; }
.map-card h3 { order: 2; }
.map-card .mc-chips { order: 4; justify-content: center; }
.map-card .minifl { justify-content: center; width: 100%; max-width: 560px; }
.map-card.swap .mc-body > * { animation: mc-in 0.22s ease-out; }
@media (prefers-reduced-motion: reduce) { .map-card.swap .mc-body > * { animation: none; } }

/* On the signal-path intro screen the strip at the top is selectable */
.ipath.selectable li { cursor: pointer; }
.ipath.selectable li:hover .pnode { border-color: var(--blue); transform: translateY(-1px); }
.ipath.selectable li:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; border-radius: 8px; }

/* Contents dialog footer: Close, with a quiet Reset course control at the far end */
.toc-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.reset-btn { font: inherit; font-size: 0.85rem; padding: 6px 10px; background: transparent; color: var(--ink); border: 0; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; opacity: 0.75; }
.reset-btn:hover { opacity: 1; }
.reset-btn.armed { opacity: 1; font-weight: 700; color: #8a2a1a; border: 1.5px solid #8a2a1a; border-radius: var(--r); text-decoration: none; }

/* Draw the eye to the strip at the top on the signal-path intro: a slow pulse until it is first used */
.look-up { color: var(--blue); white-space: nowrap; }
.look-up svg { width: 0.9em; height: 0.9em; margin-right: 0.2em; vertical-align: -0.05em; }
.ipath.nudge li .pnode { animation: strip-nudge 1.8s ease-in-out infinite; }
.ipath.nudge li:nth-child(2) .pnode { animation-delay: 0.12s; } .ipath.nudge li:nth-child(3) .pnode { animation-delay: 0.24s; } .ipath.nudge li:nth-child(4) .pnode { animation-delay: 0.36s; }
.ipath.nudge li:nth-child(5) .pnode { animation-delay: 0.48s; } .ipath.nudge li:nth-child(6) .pnode { animation-delay: 0.6s; } .ipath.nudge li:nth-child(7) .pnode { animation-delay: 0.72s; } .ipath.nudge li:nth-child(8) .pnode { animation-delay: 0.84s; }
@keyframes strip-nudge { 0%, 100% { box-shadow: 0 0 0 0 rgba(47, 103, 152, 0); } 50% { box-shadow: 0 0 0 5px rgba(47, 103, 152, 0.28); } }
@media (prefers-reduced-motion: reduce) { .ipath.nudge li .pnode { animation: none; border-color: var(--blue); } }

/* Figures in the text that switch units when clicked: styled like text, with a faint dotted underline as the only hint */
.unit { font: inherit; color: inherit; background: none; border: 0; padding: 0; margin: 0; cursor: pointer; border-bottom: 1.5px dotted rgba(47, 103, 152, 0.7); border-radius: 0; }
.unit:hover { color: var(--blue); border-bottom-style: solid; }

/* Wave-shape buttons in the oscillator header: icons only */
.wavetypes { display: inline-flex; gap: 6px; margin-left: 10px; }
.wtype { width: 38px; height: 32px; padding: 0; display: grid; place-items: center; cursor: pointer; background: transparent; color: var(--ink); border: 1.5px solid rgba(68, 64, 61, 0.35); border-radius: var(--r); transition: background 0.15s, border-color 0.15s, color 0.15s; }
.wtype svg { width: 26px; height: 19px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.wtype:hover { border-color: var(--blue); }
.wtype[aria-checked="true"] { background: #e7eff7; border-color: var(--blue); color: var(--blue); }
@media (prefers-reduced-motion: reduce) { .wtype { transition: none; } }

/* Wave-shape buttons centred in the oscillator header (they flow inline again where there is no room) */
.wr-head { position: relative; }
.wavetypes { position: absolute; left: 50%; top: 50%; margin: -5px 0 0; transform: translate(-50%, -50%); }
@media (max-width: 640px) { .wavetypes { position: static; transform: none; margin: 0 0 0 8px; } }

/* Level change: the knob sits at the vertical middle of the graph */
.dbrig .wr-body { align-items: center; }

/* The module line stays wherever it fits (it was hidden below 900px), with a little air between it and the strip */
@media (min-width: 761px) { :root { --top-h: 98px; } .modline { display: block; } .topbar { gap: 9px; padding-top: 7px; } }
@media (min-width: 521px) and (max-width: 760px) { :root { --top-h: 92px; } .modline { display: block; } .topbar { gap: 9px; padding-top: 8px; } }

/* Practice controls on the introduction screen */
.ctl-strips { display: flex; justify-content: center; align-items: flex-start; flex-wrap: wrap; gap: 36px; width: 100%; }
.ctlrig .faderbox { height: 150px; }
.ctlrig .wr-unit .lcd { width: 100px; }
.ctl-how { margin-top: 14px; }
.ctl-keys { margin: 8px 0 0; }
kbd { font: inherit; font-size: 0.85em; padding: 0 5px; border: 1.5px solid rgba(68, 64, 61, 0.55); border-bottom-width: 2.5px; border-radius: 4px; background: var(--card); }
.ctl-strips { align-items: center; }
.ctlrig .faderbox { height: 112px; }
.ctl-how h3 { margin-top: 4px; }

/* The one rule for every control: drag up or down */
.drag-hint { display: inline-flex; align-items: center; gap: 5px; margin: 2px 0 4px; font-size: 0.78rem; font-weight: 700; color: var(--blue); }
.drag-hint svg { width: 11px; height: 15px; fill: var(--blue); }

/* Bullet lists inside the centred stage cards: the block stays centred, the text lines up on the left with its bullets */
.map-card ul { text-align: left; width: fit-content; max-width: 100%; margin-inline: auto; }

/* Contents dialog: the option that lifts completion requirements */
.free-nav { display: flex; gap: 12px; align-items: flex-start; margin: 0 0 14px; padding: 10px 12px; border: 1.5px solid rgba(68, 64, 61, 0.35); border-radius: var(--r); cursor: pointer; }
.free-nav input { width: 20px; height: 20px; margin: 2px 0 0; flex: none; accent-color: var(--blue); cursor: pointer; }
.free-nav span { display: flex; flex-direction: column; gap: 2px; }
.free-nav small { font-size: 0.82rem; opacity: 0.85; }

/* Phones: the bottom bar becomes two rows (progress above, buttons below) so nothing is cut off or crowded */
@media (max-width: 600px) {
  :root { --bar-h: 90px; }
  .bar { display: grid; grid-template-columns: auto auto 1fr auto auto; grid-template-areas: "prog prog prog prog count" "about toc . prev next"; row-gap: 8px; column-gap: 8px; align-items: center; padding: 8px 12px 10px; }
  .bar .progress { grid-area: prog; }
  .bar .count { grid-area: count; min-width: 0; font-size: 0.85rem; }
  .bar #about-btn { grid-area: about; }
  .bar #toc-btn { grid-area: toc; }
  .bar #prev { grid-area: prev; }
  .bar #next { grid-area: next; }
  .bar button { padding: 7px 14px; }
  .bar button.menu { padding: 7px 12px; }
  .gate-pop { right: 12px; max-width: calc(100vw - 24px); }
}

/* Small replicas of the Back and Next keys, for use inside sentences */
.keyicon { display: inline-block; padding: 0 11px; font-size: 0.88em; line-height: 1.55; color: var(--ink); white-space: nowrap; vertical-align: 0.04em; background: linear-gradient(#fdfbf6, #e5dfd0); border: 1.5px solid var(--ink); border-radius: 8px; box-shadow: 0 2px 0 rgba(68, 64, 61, 0.55), inset 0 1px 0 #fff; }
.keyicon.primary { color: #fff; background: linear-gradient(#3b78ad, #2a5d8b); border-color: #22507a; box-shadow: 0 2px 0 #1b3f61, inset 0 1px 0 rgba(255, 255, 255, 0.25); }
.ctl-strips { align-items: flex-end; }

/* The box that follows the pointer while a knob or slider is held */
.drag-tip { position: fixed; left: 0; top: 0; z-index: 30; display: inline-flex; align-items: center; gap: 7px; padding: 6px 12px; font-size: 0.9rem; white-space: nowrap; color: #fff; background: var(--blue); border: 1.5px solid #22507a; border-radius: var(--r); box-shadow: 0 3px 10px rgba(0, 0, 0, 0.3); pointer-events: none; }
.drag-tip[hidden] { display: none; }
.drag-tip svg { width: 11px; height: 15px; fill: #fff; flex: none; }

/* A note box set inside a lead paragraph */
.lead .lead-note { display: block; margin-top: 12px; padding: 9px 14px; font-size: 0.9rem; line-height: 1.5; background: #e7eff7; border: 1.5px solid var(--blue); border-radius: var(--r); }
.lead .lead-note b { letter-spacing: 0.08em; color: var(--blue); }

/* Phones: when the microphones stack, each one is its own card, so the information doesn't run together */
@media (max-width: 760px) {
  .polars3 { gap: 20px 0; }
  .polars3 figure { padding: 14px 14px 16px; background: rgba(255, 255, 255, 0.5); border: 1.5px solid rgba(68, 64, 61, 0.3); border-radius: var(--r); box-shadow: 0 3px 0 rgba(68, 64, 61, 0.16); }
}

/* Converter console: the display fills the space beside the two knobs */
.adcrig .gr-wavecol { display: flex; flex-direction: column; }
.demo .adcrig canvas.adc { flex: 1 1 auto; height: auto; min-height: 220px; background: rgba(250, 249, 245, 0.9); border: 1px solid rgba(68, 64, 61, 0.25); border-radius: 4px; }

/* The key above the converter graph */
.adc-key { list-style: none; display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 0 0 8px; padding: 0; font-size: 0.82rem; }
.adc-key li { display: inline-flex; align-items: center; gap: 8px; }
.adc-key svg { width: 28px; height: 16px; flex: none; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.adc-key .k-real { stroke: var(--blue); stroke-width: 2.4; }
.adc-key .k-stored { stroke: var(--red); stroke-width: 2.4; }
.adc-key circle { fill: var(--ink); stroke: none; }
.adc-key .k-grid { stroke: rgba(68, 64, 61, 0.45); stroke-width: 1.2; }
.adcrig .wr-body { align-items: center; }
.adcrig .wr-body .wr-strips { align-self: center; }

/* Instructions: a "Try it" label and the steps in small italics, on their own line under the page's introduction */
.lead .lead-instr { display: block; margin-top: 12px; font-size: 0.85rem; font-style: italic; line-height: 1.5; }
.lead .lead-instr::before { content: "Try it"; margin-right: 10px; font-style: normal; font-weight: 700; font-size: 0.68rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--blue); }

/* A small copy of the record key, for use inside a sentence */
.reckey-icon { display: inline-grid; place-items: center; width: 1.7em; height: 1.45em; vertical-align: middle; margin: 0 2px 2px; background: linear-gradient(#fdfbf6, #e5dfd0); border: 1.5px solid var(--ink); border-radius: 6px; box-shadow: 0 2px 0 rgba(68, 64, 61, 0.55), inset 0 1px 0 #fff; }
.reckey-icon i { width: 0.7em; height: 0.7em; border-radius: 50%; background: #b3302a; box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.18); }

/* The ordering activities: a signal-flow list. Each step has its round icon, and a fixed line with an arrowhead joins one step to the next */
.order-wrap { --slot: 60px; --gap: 28px; --nodeX: 63px; position: relative; max-width: 460px; margin-bottom: 14px; }
.order-wrap .order { margin-bottom: 0; max-width: none; }
.order-wrap .order li { min-height: var(--slot); box-sizing: border-box; margin-bottom: var(--gap); padding-block: 8px; }
.order-wrap .order li:last-child { margin-bottom: 0; }
.order .grip { width: 12px; flex: none; }
.order .onode { width: 42px; height: 42px; flex: none; box-sizing: border-box; display: grid; place-items: center; background: var(--card); border: 2px solid rgba(68, 64, 61, 0.4); border-radius: 50%; }
.order .onode[hidden] { display: none; }
.order .onode canvas { width: 28px; height: 28px; display: block; background: none; border: 0; }
.order-links { position: absolute; left: 0; right: 0; top: var(--slot); display: flex; flex-direction: column; gap: var(--slot); pointer-events: none; }
.order-links span { height: var(--gap); position: relative; }
.order-links svg { position: absolute; left: calc(var(--nodeX) - 8px); top: 1px; width: 16px; height: calc(var(--gap) - 2px); fill: none; stroke: rgba(68, 64, 61, 0.55); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* Short definitions inside a lead paragraph, each on its own line */
.lead .lead-term { display: block; margin-top: 8px; font-size: 1rem; line-height: 1.5; }

/* The third cue tile: both cues together */
.eartile.both { --c: var(--green); --tint: rgba(74, 122, 53, 0.14); }
.loctiles { grid-template-columns: repeat(3, minmax(0, 1fr)); max-width: 900px; }
@media (max-width: 760px) { .loctiles { grid-template-columns: 1fr; } }

/* Phones: audit fixes */
/* The oscillator header wraps, with the wave-shape buttons on their own row */
@media (max-width: 640px) {
  .waverig .wr-head { flex-wrap: wrap; row-gap: 8px; }
  .waverig .wr-head .wavetypes { order: 3; flex-basis: 100%; justify-content: center; margin: 0; }
}
/* The direction diagram can be dragged by touch without scrolling the page */
.demo .locrig canvas.loccv { touch-action: none; }
/* The bottom bar on very small phones */
@media (max-width: 360px) {
  .bar { padding-left: 8px; padding-right: 8px; column-gap: 6px; }
  .bar button { padding-left: 10px; padding-right: 10px; }
  .bar button.menu { padding-left: 9px; padding-right: 9px; }
}
/* The mixer scrolls sideways when the channels do not all fit: a hint and soft edges show only then (the script adds .on and .scrolls) */
.mixer-swipe { display: none; margin: 0 0 6px; font-size: 0.8rem; font-style: italic; text-align: right; opacity: 0.8; }
.mixer-swipe.on { display: block; }
.mixer.scrolls { background: linear-gradient(to left, rgba(68, 64, 61, 0.22), rgba(68, 64, 61, 0) 18px) right center / 18px 100% no-repeat scroll, linear-gradient(to right, rgba(68, 64, 61, 0.22), rgba(68, 64, 61, 0) 18px) left center / 18px 100% no-repeat scroll; }
  .mixer { background: linear-gradient(to left, rgba(68, 64, 61, 0.22), rgba(68, 64, 61, 0) 18px) right center / 18px 100% no-repeat scroll, linear-gradient(to right, rgba(68, 64, 61, 0.22), rgba(68, 64, 61, 0) 18px) left center / 18px 100% no-repeat scroll; }
}

/* Phones: the stage stepper stays at the bottom of the screen, so the arrows are always in view */
@media (max-width: 760px) {
  .flow-nav.stagenav { position: sticky; bottom: 0; z-index: 3; margin: 0; padding: 10px 0 6px; background: var(--bg); }
}
@media (max-width: 760px) {
  /* the stage pages sit at the top, and the stepper rests at the bottom of the screen, so nothing moves from stage to stage */
  .center:has(.flow-card) { justify-content: flex-start; }
  .center:has(.flow-card) .inner { flex: 1; display: flex; flex-direction: column; }
  .center:has(.flow-card) .demo { flex: 1; display: flex; flex-direction: column; }
  .center:has(.flow-card) .flow-nav.stagenav { margin-top: auto; }
}
@media (max-width: 760px) {
  .center:has(.flow-card) { padding-bottom: 0; }
  .center:has(.flow-card) .flow-nav.stagenav { padding-bottom: 12px; }
}

/* Phones: the icon canvas fits inside the smaller badge circle (it was 76px in a 72px circle, so it sat off-centre) */
@media (max-width: 560px) { .demo .mc-icon canvas, .mc-icon canvas { width: 58px; height: 58px; } }

/* Phones: every step in an ordering list is the same height (names may wrap to two or three lines), so the fixed arrows between them always line up */
@media (max-width: 560px) {
  .order-wrap { --slot: 72px; }
  .order-wrap .order li { height: var(--slot); padding-block: 6px; }
  .order-wrap .order .name { font-size: 0.98rem; line-height: 1.2; }
}

/* Phones: the channel strip flow becomes a vertical list, so the order reads clearly (a row of five would wrap into two) */
@media (max-width: 560px) {
  .minifl { flex-direction: column; flex-wrap: nowrap; row-gap: 0; align-items: flex-start; width: fit-content; margin-inline: auto; }
  .minifl li { flex: none; flex-direction: row; align-items: center; justify-content: flex-start; gap: 14px; text-align: left; margin-top: 20px; }
  .minifl li:first-child { margin-top: 0; }
  .minifl li:not(:first-child)::before, .minifl li:nth-child(4)::before { display: block; top: -20px; left: 21px; width: 0; height: 20px; border-top: 0; border-left: 2.5px solid var(--green); }
  .minifl li:not(:first-child)::after, .minifl li:nth-child(4)::after { display: block; top: -11px; left: 17.5px; width: 8px; height: 8px; border-top: 0; border-right: 2.5px solid var(--green); border-bottom: 2.5px solid var(--green); transform: rotate(45deg); }
  .minifl .mf-label { font-size: 1rem; text-align: left; }
}

/* Phones: the formats branch downward from the studio session along a dashed rail, like a file tree, instead of fanning out sideways */
@media (max-width: 760px) {
  .reltree { display: block; }
  .relroot { width: 100%; }
  .relbranches { display: flex; flex-direction: column; gap: 14px; padding-left: 40px; margin-top: 14px; }
  .relbranches .relcard { position: relative; }
  .relbranches .relcard::before { content: ""; position: absolute; left: -22px; top: -14px; height: calc(100% + 14px); border-left: 2px dashed var(--ink); }
  .relbranches .relcard:last-child::before { height: 40px; }
  .relbranches .relcard::after { content: ""; position: absolute; left: -22px; top: 15px; width: 22px; height: 22px; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 22 22'%3E%3Cpath d='M0 11H19M14 6L19 11L14 16' fill='none' stroke='%2344403d' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right center / 22px 22px; }
}
