/* Single-Case Design Graphs — usf.ac/ssd */
:root {
  --ink: #17221d;
  --muted: #5d6b64;
  --line: #dce4df;
  --surface: #ffffff;
  --canvas: #f4f7f5;
  --green: #0b6745;
  --green-dark: #064830;
  --green-soft: #e4f0ea;
  --gold: #f2c14e;
  --gold-soft: #fdf3d8;
  --night: #07100c;
  --win: #0f5ea8;
  --mac: #5b5b66;
  --excel: #107c41;
  --code: #0e1a15;
  --field-border: #7c8d84; /* text-field and select outlines: 3.5:1 on white (WCAG 1.4.11) */
  --focus: var(--green-dark);
  --radius: 16px;
}

* { box-sizing: border-box; }
/* ssd.js sets --sticky-offset to the measured height of whatever is pinned at the top
   (header, plus the Windows/Mac bar on lessons), so anchors and keyboard focus land below it. */
html { background: var(--canvas); scroll-behavior: smooth; scroll-padding-top: var(--sticky-offset, 84px); }
body {
  margin: 0;
  color: var(--ink);
  background: var(--canvas);
  font-family: "Segoe UI", Helvetica, Arial, sans-serif;
  font-size: 17px;
  line-height: 1.65;
  -webkit-text-size-adjust: 100%;
}
a { color: var(--green); text-underline-offset: 3px; }
a:hover { color: var(--green-dark); }
img { max-width: 100%; }
/* Focus ring: dark green, at least 9:1 against the canvas, white cards, and the pale control tracks. */
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
/* Scrolling boxes can take keyboard focus; draw their ring inside so a clipping parent can't hide it. */
.tabs:focus-visible, .ribbon:focus-visible, .sheet-scroll:focus-visible, .table-scroll:focus-visible, .pm-table > div:focus-visible, .prompt pre:focus-visible { outline-offset: -3px; }
/* Scrolling boxes are containing blocks, so the absolutely positioned screen-reader text inside them
   (.visually-hidden) stays in the box. Otherwise it sits at the far end of a wide table, outside the
   box's clipping, and makes the whole page scroll sideways on a phone (WCAG 1.4.10 Reflow). */
.tabs, .ribbon, .sheet-scroll, .table-scroll, .pm-table > div, .prompt pre { position: relative; }
/* The hidden attribute always wins, even over a class that sets display (flex rows, toggles, actions). */
[hidden] { display: none !important; }
/* Text for screen readers only. .sr-only is the same rule under its common name (used by practice.js). */
.visually-hidden, .sr-only { position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0; }
/* Hints about controls that only exist when ssd.js runs (it adds html.js); hidden without JavaScript. */
html:not(.js) .js-only { display: none !important; }
.wrap { width: min(100% - 32px, 1120px); margin: 0 auto; }

/* Header */
.top {
  position: sticky; top: 0; z-index: 20;
  background: rgba(244, 247, 245, .92);
  backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--line);
}
.top .wrap { display: flex; align-items: center; gap: 18px; min-height: 64px; }
/* The wordmark holds two links: "USF.ac" goes to the site's homepage, the series name to the overview. */
.wordmark { display: inline-flex; align-items: center; gap: 6px; color: var(--ink); font-weight: 720; letter-spacing: -.02em; white-space: nowrap; }
.wordmark a { color: inherit; text-decoration: none; text-underline-offset: 3px; }
.wordmark > a { display: inline-flex; align-items: center; gap: 10px; }
.wordmark > a:hover > span:not(.wordmark-mark), .wordmark small a:hover { text-decoration: underline; }
.wordmark-mark { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 9px; color: #fff; background: var(--green); font-weight: 760; box-shadow: inset 0 -3px 0 rgba(0, 0, 0, .1); }
.wordmark small { color: var(--muted); font-weight: 600; }
/* The padding (cancelled by the negative margin) keeps focus rings inside the scroll box, which would clip them. */
.top nav { display: flex; gap: 4px; margin: -6px -6px -6px auto; padding: 6px; overflow-x: auto; scrollbar-width: none; }
.top nav a { padding: 7px 12px; border-radius: 999px; color: var(--ink); font-size: .9rem; font-weight: 600; text-decoration: none; white-space: nowrap; }
.top nav a:hover { background: #e7eee9; }
.top nav a[aria-current="page"] { background: var(--green); color: #fff; }

/* Hub hero */
.hero { padding: 64px 0 40px; }
.eyebrow { margin: 0 0 12px; color: var(--green); font-size: .78rem; font-weight: 760; letter-spacing: .13em; text-transform: uppercase; }
h1 { margin: 0; font-size: clamp(2.3rem, 6.5vw, 4.4rem); line-height: 1.02; letter-spacing: -.055em; }
.hero .lede { max-width: 640px; margin: 22px 0 0; color: var(--muted); font-size: clamp(1.05rem, 2vw, 1.22rem); }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 44px; align-items: center; }
.hero-figure { margin: 0; padding: 18px 18px 12px; border: 1px solid var(--line); border-radius: 20px; background: #fff; box-shadow: 0 24px 60px rgba(23, 34, 29, .08); }
.hero-figure img { display: block; width: 100%; height: auto; }
.hero-figure figcaption { margin-top: 6px; color: var(--muted); font-size: .8rem; text-align: center; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 30px; }
.button { display: inline-flex; align-items: center; gap: 8px; min-height: 46px; padding: 0 22px; border-radius: 999px; font-weight: 650; text-decoration: none; transition: transform .15s ease, background-color .15s ease; }
.button:hover { transform: translateY(-2px); }
.button-primary { color: #fff; background: var(--green); }
.button-primary:hover { color: #fff; background: var(--green-dark); }
.button-ghost { color: var(--ink); border: 1px solid #c9d6ce; background: #fff; }
.button-ghost:hover { color: var(--ink); background: #f8fbf9; }

/* Sections and cards */
.section { padding: 34px 0 30px; }
.section > h2, .section-head h2 { margin: 0 0 6px; font-size: clamp(1.5rem, 3vw, 2rem); letter-spacing: -.035em; line-height: 1.2; }
.section-head p { margin: 0 0 22px; color: var(--muted); max-width: 680px; }
.series-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.series-card { display: flex; flex-direction: column; padding: 24px; border: 1px solid var(--line); border-radius: 20px; background: #fff; color: var(--ink); text-decoration: none; box-shadow: 0 10px 30px rgba(23, 34, 29, .04); transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease; }
.series-card:hover { color: var(--ink); transform: translateY(-3px); border-color: rgba(11, 103, 69, .4); box-shadow: 0 18px 38px rgba(23, 34, 29, .09); }
.series-num { display: inline-grid; place-items: center; width: 38px; height: 38px; margin-bottom: 16px; border-radius: 11px; background: var(--green-soft); color: var(--green); font-weight: 760; }
.series-card h3 { margin: 0 0 6px; font-size: 1.2rem; letter-spacing: -.02em; line-height: 1.3; }
.series-card p { margin: 0 0 14px; color: var(--muted); font-size: .95rem; line-height: 1.55; }
.series-card ol { margin: auto 0 0; padding: 14px 0 0 1.2em; border-top: 1px solid var(--line); color: var(--muted); font-size: .88rem; line-height: 1.7; }
.series-card .go { margin-top: 14px; color: var(--green); font-weight: 650; font-size: .92rem; }

/* Anatomy */
.anatomy { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 28px; align-items: start; padding: 26px; border: 1px solid var(--line); border-radius: 22px; background: #fff; }
.anatomy-figure { margin: 0; }
.anatomy-graph { position: relative; }
.anatomy-cap { position: relative; display: block; margin: 0 0 10px; padding-left: 36px; font-size: .95rem; line-height: 1.45; }
.anatomy-cap .fig-num { display: block; font-weight: 700; }
.anatomy-cap .fig-title { display: block; font-style: italic; }
.anatomy-figure .fig-note { margin: 10px 0 0; font-size: .86rem; line-height: 1.5; }
.anatomy-figure img { display: block; width: 100%; height: auto; }
.pin { position: absolute; width: 26px; height: 26px; margin: -13px 0 0 -13px; display: grid; place-items: center; border-radius: 50%; background: var(--gold); color: #3b2c00; font-size: .78rem; font-weight: 800; box-shadow: 0 0 0 3px #fff, 0 4px 10px rgba(0, 0, 0, .18); }
.anatomy ol { margin: 0; padding: 0; list-style: none; counter-reset: pin; }
.anatomy li { position: relative; padding: 0 0 12px 40px; counter-increment: pin; font-size: .95rem; line-height: 1.5; }
.anatomy li::before { content: counter(pin); position: absolute; left: 0; top: -1px; width: 26px; height: 26px; display: grid; place-items: center; border-radius: 50%; background: var(--gold); color: #3b2c00; font-size: .78rem; font-weight: 800; }
.anatomy li strong { display: block; }

.checklist { columns: 2; column-gap: 32px; margin: 0; padding: 22px 26px; border: 1px solid var(--line); border-radius: 20px; background: #fff; list-style: none; }
.checklist li { break-inside: avoid; position: relative; padding: 4px 0 8px 30px; font-size: .95rem; line-height: 1.5; }
/* "Check before moving on" lists: each item gets an empty box, a to-do for the reader.
   Add .done to the list only where the items are already met (a filled box with a tick). */
.checklist li::before { content: ""; position: absolute; left: 0; top: 7px; width: 18px; height: 18px; border: 2px solid var(--green); border-radius: 5px; }
.checklist.done li::before { background: var(--green-soft); }
.checklist.done li::after { content: ""; position: absolute; left: 6px; top: 9px; width: 5px; height: 10px; border: solid var(--green); border-width: 0 2.5px 2.5px 0; transform: rotate(45deg); }

/* Lesson layout */
.lesson-shell { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 48px; padding: 36px 0 60px; }
.sidebar { position: sticky; top: 88px; align-self: start; max-height: calc(100vh - 110px); overflow: auto; }
/* ssd.js fills the sidebar. Until it does (or without JavaScript), the empty box keeps its column but isn't shown. */
.sidebar:empty { visibility: hidden; }
.sidebar summary { display: none; }
/* The series name: a paragraph, not a heading, so the lesson's h1 is the first heading on the page. */
.sidebar .sidebar-title { margin: 0 0 10px; color: var(--muted); font-size: .75rem; font-weight: 760; letter-spacing: .12em; line-height: 1.5; text-transform: uppercase; }
.sidebar ol { margin: 0 0 22px; padding: 0; list-style: none; counter-reset: l; }
.sidebar li { counter-increment: l; }
.sidebar a { display: flex; gap: 10px; padding: 8px 10px; border-radius: 10px; color: var(--ink); font-size: .92rem; line-height: 1.35; text-decoration: none; }
.sidebar a::before { content: counter(l); flex: none; width: 22px; height: 22px; display: grid; place-items: center; border-radius: 50%; background: #e3ebe6; color: var(--muted); font-size: .72rem; font-weight: 750; }
.sidebar a:hover { background: #e9f0ec; }
.sidebar a[aria-current="page"] { background: var(--green-soft); color: var(--green-dark); font-weight: 650; }
.sidebar a[aria-current="page"]::before { background: var(--green); color: #fff; }
.sidebar .other { display: block; padding: 10px; border-top: 1px solid var(--line); color: var(--green); font-size: .88rem; font-weight: 600; text-decoration: none; }
.sidebar .other::before { content: none; }
.sidebar a:focus-visible { outline-offset: -3px; } /* inside the link, so the scrolling sidebar can't clip the ring */

article { min-width: 0; max-width: 780px; }
.crumbs { margin: 0 0 10px; color: var(--muted); font-size: .85rem; }
.crumbs a { color: var(--muted); }
article h1 { font-size: clamp(2rem, 5vw, 3rem); letter-spacing: -.045em; line-height: 1.08; }
article .lede { margin: 16px 0 26px; color: var(--muted); font-size: 1.12rem; }
/* Learning objectives, right under the lede */
.objectives { margin: 18px 0 26px; padding: 14px 18px; border: 1px solid var(--line); border-left: 4px solid var(--green); border-radius: 14px; background: #fff; font-size: .95rem; line-height: 1.55; }
.objectives p { margin: 0 0 4px; }
.objectives ul { margin: 0; padding-left: 1.2em; }
.objectives li { margin: 2px 0; }
article h2 { margin: 46px 0 12px; font-size: 1.55rem; letter-spacing: -.03em; line-height: 1.25; scroll-margin-top: 8px; }
article h3 { margin: 30px 0 8px; font-size: 1.15rem; letter-spacing: -.015em; line-height: 1.35; }
article p, article li { max-width: 72ch; }
article ul, article ol { padding-left: 1.3em; }
article li { margin: 4px 0; }
kbd { display: inline-block; min-width: 1.6em; padding: 0 6px; border: 1px solid #c8d3cc; border-bottom-width: 2px; border-radius: 6px; background: #fff; font: 600 .82em/1.6 "Segoe UI", Helvetica, Arial, sans-serif; text-align: center; white-space: nowrap; }
code { padding: 1px 6px; border-radius: 6px; background: #e8eeea; font: .88em/1.5 Consolas, "SF Mono", Menlo, monospace; overflow-wrap: anywhere; } /* long formulas break rather than scroll the page */

.meta { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 8px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 11px; border-radius: 999px; background: #e7eee9; color: #3f5148; font-size: .8rem; font-weight: 650; }

/* Windows / Mac switch */
.os-switch { position: sticky; top: 72px; z-index: 10; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 0 0 24px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 14px; background: rgba(255, 255, 255, .94); backdrop-filter: blur(8px); }
.os-switch > span { color: var(--muted); font-size: .85rem; font-weight: 600; }
.seg { display: inline-flex; padding: 3px; border-radius: 999px; background: #e7eee9; }
.seg button { border: 0; padding: 6px 16px; border-radius: 999px; background: transparent; color: var(--ink); font: 650 .88rem "Segoe UI", Helvetica, Arial, sans-serif; cursor: pointer; }
.seg button[aria-pressed="true"] { background: var(--green); color: #fff; }
.os-note { color: var(--muted); font-size: .8rem; }
html.os-win [data-os="mac"], html.os-mac [data-os="win"] { display: none !important; }
.os-label { display: none; }
html:not(.os-win):not(.os-mac) .os-label { display: inline-block; margin-right: 6px; padding: 0 8px; border-radius: 6px; background: #e7eee9; font-size: .72rem; font-weight: 750; text-transform: uppercase; }

/* Steps */
.steps { margin: 18px 0 8px; padding: 0; list-style: none; counter-reset: step; }
.steps > li { position: relative; margin: 0; padding: 0 0 22px 52px; counter-increment: step; }
.steps > li::before { content: counter(step); position: absolute; left: 0; top: 0; width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; background: var(--green); color: #fff; font-weight: 760; font-size: .92rem; }
.steps > li::after { content: ""; position: absolute; left: 16.5px; top: 40px; bottom: 6px; width: 1px; background: var(--line); }
.steps > li:last-child::after { display: none; }
.steps > li > strong:first-child { display: block; margin-bottom: 2px; padding-top: 4px; font-size: 1.02rem; }
/* .steps.run-in: the bold words begin the step's sentence ("Count the points ..."), so they stay
   on its first line instead of becoming a heading line of their own. */
.steps.run-in > li { padding-top: 4px; }
.steps.run-in > li > strong:first-child { display: inline; margin: 0; padding: 0; font-size: inherit; }

/* UI references */
/* Inline blocks never break across lines unless a label is wider than the whole line,
   so long labels wrap inside their box instead of forcing sideways scrolling at 320px. */
.ui { display: inline-block; padding: 0 7px; border: 1px solid #cbd8d0; border-radius: 6px; background: #fff; font-size: .88em; font-weight: 650; line-height: 1.6; }
.path { display: inline; }
.path .sep { margin: 0 3px; color: var(--muted); }
.value { display: inline-block; padding: 0 7px; border-radius: 6px; background: var(--gold-soft); font: 650 .86em/1.6 Consolas, "SF Mono", Menlo, monospace; overflow-wrap: anywhere; }
/* On a warning callout's gold fill, a value chip gets a white box and a gold edge so it still reads as a chip. */
.callout-warn .value { background: #fff; box-shadow: inset 0 0 0 1px #ead7a1; }

/* Figures */
figure.shot { margin: 22px 0 26px; }
figure.shot .frame { padding: 14px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
figure.shot img { display: block; width: 100%; height: auto; }
figure.shot figcaption { margin-top: 8px; color: var(--muted); font-size: .86rem; line-height: 1.5; }
figure.shot figcaption b { color: var(--ink); }
.compare { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.compare figure { margin: 0; }
.tag { display: inline-block; margin-bottom: 6px; padding: 2px 9px; border-radius: 999px; font-size: .74rem; font-weight: 750; letter-spacing: .02em; }
.tag-bad { background: #fde6e2; color: #9b2c1c; }
.tag-good { background: var(--green-soft); color: var(--green-dark); }

/* Callouts */
.callout { margin: 22px 0; padding: 16px 18px 16px 50px; border-radius: 14px; position: relative; font-size: .95rem; line-height: 1.6; }
.callout::before { position: absolute; left: 16px; top: 15px; width: 22px; height: 22px; display: grid; place-items: center; border-radius: 50%; font-weight: 800; font-size: .8rem; }
.callout p { margin: 0 0 6px; }
.callout p:last-child { margin: 0; }
.callout-tip { background: var(--green-soft); }
.callout-tip::before { content: "✓"; background: var(--green); color: #fff; }
.callout-why { background: #eef2f7; }
.callout-why::before { content: "?"; background: #3f5f86; color: #fff; }
.callout-warn { background: var(--gold-soft); }
.callout-warn::before { content: "!"; background: #946a00; color: #fff; }

/* Mock Excel UI */
.mock { margin: 22px 0 26px; }
.mock figcaption { margin-top: 8px; color: var(--muted); font-size: .86rem; }
.mock-note { font-style: italic; }
.window { overflow: hidden; border: 1px solid #c9d3cd; border-radius: 12px; background: #fff; box-shadow: 0 14px 34px rgba(23, 34, 29, .08); font-family: "Segoe UI", -apple-system, Helvetica, Arial, sans-serif; font-size: 13px; line-height: 1.4; color: #1f1f1f; }
.window-bar { display: flex; align-items: center; gap: 8px; padding: 8px 12px; background: var(--excel); color: #fff; font-size: 12px; font-weight: 600; }
.window-bar.mac { background: #e9e9ec; color: #333; }
.dots { display: inline-flex; gap: 6px; }
.dots i { width: 11px; height: 11px; border-radius: 50%; background: #ff5f57; }
.dots i:nth-child(2) { background: #febc2e; }
.dots i:nth-child(3) { background: #28c840; }
.tabs { display: flex; gap: 2px; padding: 0 10px; border-bottom: 1px solid #e1e1e1; background: #f8f8f8; overflow-x: auto; }
.tabs span { padding: 7px 10px; color: #444; white-space: nowrap; }
.tabs span.on { color: var(--excel); font-weight: 650; box-shadow: inset 0 -3px 0 var(--excel); }
.ribbon { display: flex; gap: 0; padding: 10px; background: #fbfbfb; overflow-x: auto; }
.group { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 0 14px; border-right: 1px solid #e3e3e3; }
.group:last-child { border-right: 0; }
.group .btns { display: flex; gap: 6px; }
.group small { color: #666; font-size: 11px; }
.rb { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 6px; color: #444; }
.rb svg { width: 26px; height: 26px; }
.rb.hot { background: #dff0e6; outline: 2px solid var(--excel); }
.menu { position: relative; margin: 0 0 0 auto; width: max-content; max-width: 100%; padding: 10px; border: 1px solid #d5d5d5; border-radius: 8px; background: #fff; box-shadow: 0 10px 24px rgba(0, 0, 0, .14); }
.menu-title { margin: 0 0 6px; color: #555; font-size: 12px; font-weight: 650; }
.menu-icons { display: flex; gap: 6px; }
.mi { display: grid; place-items: center; width: 46px; height: 40px; border: 1px solid transparent; border-radius: 6px; color: #333; }
.mi svg { width: 34px; height: 28px; }
.mi.hot { border-color: var(--excel); background: #dff0e6; }
.menu-tip { margin-top: 6px; padding: 3px 8px; border-radius: 4px; background: #222; color: #fff; font-size: 11.5px; width: max-content; max-width: 100%; }
.ribbon-wrap { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 12px; padding: 0 12px 12px; background: #fbfbfb; }

/* Format pane mock */
.pane-wrap { display: grid; grid-template-columns: minmax(0, 1fr) 290px; gap: 0; }
.pane-canvas { display: grid; place-items: center; padding: 16px; background: #f3f3f3; }
.pane-canvas img { width: 100%; height: auto; background: #fff; }
.pane { border-left: 1px solid #ddd; background: #fff; }
.pane-head { padding: 10px 14px 6px; font-size: 15px; font-weight: 650; }
.pane-sub { display: flex; gap: 14px; padding: 0 14px 8px; color: #555; font-size: 12px; }
.pane-sub b { color: var(--excel); }
.pane-icons { display: flex; gap: 4px; padding: 4px 12px 8px; border-bottom: 1px solid #eee; }
.pane-icons span { display: grid; place-items: center; width: 34px; height: 30px; border-radius: 5px; color: #555; }
.pane-icons span.on { background: #e3efe8; color: var(--excel); outline: 1.5px solid var(--excel); }
.pane-icons svg { width: 18px; height: 18px; }
.pane-sec { padding: 6px 14px 10px; border-bottom: 1px solid #f0f0f0; }
.pane-sec h5 { margin: 6px 0 6px; font-size: 12.5px; font-weight: 700; }
.pane-sec h5::before { content: "▾ "; color: #777; }
.pane-sec.closed h5::before { content: "▸ "; }
.row { display: grid; grid-template-columns: 1fr 82px 44px; align-items: center; gap: 6px; margin: 4px 0 4px 10px; font-size: 12px; }
.row.two { grid-template-columns: 1fr 126px; }
.field { padding: 2px 6px; border: 1px solid #c8c8c8; border-radius: 4px; background: #fff; font-family: inherit; }
.field.hot { border-color: var(--excel); background: #fff8e1; box-shadow: 0 0 0 2px rgba(16, 124, 65, .25); font-weight: 700; }
.auto { color: #6b6b6b; font-size: 11px; }
.radio { display: flex; align-items: center; gap: 6px; margin: 3px 0 3px 10px; font-size: 12px; }
.radio i { width: 12px; height: 12px; border: 1.5px solid #888; border-radius: 50%; }
.radio.on i { border-color: var(--excel); background: radial-gradient(var(--excel) 45%, #fff 50%); }
.radio.on { font-weight: 650; }
.swatch { display: inline-block; width: 16px; height: 12px; border: 1px solid #999; background: #000; vertical-align: middle; }

/* Dialog mock */
.dialog { max-width: 560px; margin: 0 auto; overflow: hidden; border: 1px solid #c9c9c9; border-radius: 10px; background: #fff; box-shadow: 0 18px 44px rgba(0, 0, 0, .16); font-family: "Segoe UI", -apple-system, Helvetica, Arial, sans-serif; font-size: 13px; color: #1f1f1f; }
.dialog-title { display: flex; align-items: center; gap: 8px; padding: 8px 14px; background: #f3f3f3; border-bottom: 1px solid #ddd; font-weight: 650; }
.dialog-body { padding: 14px 16px; }
.dialog label { display: block; margin: 10px 0 3px; font-size: 12.5px; }
.dialog .input { padding: 5px 8px; border: 1px solid #bdbdbd; border-radius: 4px; font-family: Consolas, Menlo, monospace; font-size: 12.5px; }
.dialog .input.hot { border-color: var(--excel); background: #fff8e1; box-shadow: 0 0 0 2px rgba(16, 124, 65, .25); }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; padding: 0 16px 14px; }
.dialog-actions span { padding: 4px 18px; border: 1px solid #bdbdbd; border-radius: 4px; }
.dialog-actions span.primary { border-color: var(--excel); background: var(--excel); color: #fff; }
.series-list { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.listbox { border: 1px solid #ccc; border-radius: 4px; min-height: 96px; padding: 4px 0; }
.listbox div { padding: 2px 10px; }
.listbox div.sel { background: #cfe8da; }
.listbtns { display: flex; gap: 6px; margin-bottom: 6px; }
.listbtns span { padding: 1px 9px; border: 1px solid #bdbdbd; border-radius: 4px; font-size: 12px; }
.listbtns span.hot { border-color: var(--excel); background: #dff0e6; font-weight: 700; }

/* Spreadsheet mock */
/* The box hugs its table (no empty white area right of a narrow sheet) and scrolls when the table is wider. */
.sheet-scroll { width: fit-content; max-width: 100%; overflow-x: auto; border: 1px solid #c9d3cd; border-radius: 12px; background: #fff; box-shadow: 0 14px 34px rgba(23, 34, 29, .06); }
table.sheet { border-collapse: collapse; font: 13px/1.3 Calibri, Aptos, "Segoe UI", Helvetica, Arial, sans-serif; color: #1f1f1f; }
.sheet th, .sheet td { min-width: 82px; height: 24px; padding: 2px 8px; border: 1px solid #e1e1e1; text-align: right; white-space: nowrap; }
.sheet thead th { background: #f3f3f3; color: #555; font-weight: 400; text-align: center; }
.sheet tbody th { min-width: 34px; background: #f3f3f3; color: #555; font-weight: 400; text-align: center; }
.sheet thead th:first-child { min-width: 34px; } /* the empty corner cell, so the row-number column stays narrow */
.sheet td.h { font-weight: 700; text-align: center; background: #fff8e1; }
.sheet td.x { background: #f4f9f6; text-align: center; }
.sheet td.p1 { background: #eaf3ff; }
.sheet td.p2 { background: #fff1e6; }
.sheet td.p3 { background: #eef8ec; }
.sheet td.p4 { background: #f5edf9; }
.sheet td.helper { background: #f6f6f6; color: #444; }
.sheet td.note { border: 0; color: #6b6b6b; font-style: italic; text-align: left; }
.sheet .sel { outline: 2px solid var(--excel); outline-offset: -2px; }

/* Prompt blocks */
.prompt { margin: 18px 0 24px; overflow: hidden; border: 1px solid #c6d4cb; border-radius: 14px; background: #fff; }
.prompt-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 10px 8px 16px; border-bottom: 1px solid #e3ebe6; background: #f6faf7; }
.prompt-head span { color: var(--muted); font-size: .8rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.prompt-head > span { min-width: 0; } /* a long title wraps, not the Copy button */
.copy { display: inline-flex; flex: none; align-items: center; gap: 6px; padding: 6px 12px; border: 1px solid #c6d4cb; border-radius: 999px; background: #fff; color: var(--green-dark); font: 650 .82rem "Segoe UI", Helvetica, Arial, sans-serif; white-space: nowrap; cursor: pointer; }
.copy:hover { background: var(--green-soft); }
.copy.done { border-color: var(--green); background: var(--green); color: #fff; }
.prompt pre { margin: 0; padding: 16px 18px; overflow-x: auto; white-space: pre-wrap; word-break: break-word; font: .86rem/1.6 Consolas, "SF Mono", Menlo, monospace; color: var(--code); }
/* Parts of a prompt to edit: a tint, a dashed underline, and square brackets, so they don't rely on color.
   The brackets are generated content, so the copy button and text selection leave them out.
   mark.edit is the same style for text that explains the marks. */
.prompt pre mark, mark.edit { padding: 0 2px; border-radius: 3px; background: #fbe6a6; color: #5a3f00; text-decoration-line: underline; text-decoration-style: dashed; text-decoration-color: #8a6200; text-decoration-thickness: 2px; text-underline-offset: 3px; text-decoration-skip-ink: none; } /* longhands: Safari drops a shorthand that includes a thickness */
.prompt pre mark::before, mark.edit::before { content: "["; font-weight: 700; color: #5a3f00; }
.prompt pre mark::after, mark.edit::after { content: "]"; font-weight: 700; color: #5a3f00; }

/* AI assistant mock */
.ai-mock { display: grid; grid-template-columns: minmax(0, 1fr) 280px; min-height: 300px; }
/* The chart keeps its own proportions (the global img rule narrows it but would keep its height
   attribute) and sits centered beside the taller assistant pane. */
.ai-sheet { display: grid; align-items: center; padding: 14px; background: #fff; }
.ai-sheet img { display: block; width: 100%; height: auto; }
.ai-pane { display: flex; flex-direction: column; gap: 10px; padding: 12px; border-left: 1px solid #e3e3e3; background: #fafafa; }
.ai-pane-head { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 13px; }
.ai-logo { width: 22px; height: 22px; display: grid; place-items: center; border-radius: 6px; background: #d97757; color: #fff; font-size: 12px; font-weight: 800; }
.ai-logo.gpt { background: #10a37f; }
.bubble { padding: 9px 11px; border-radius: 10px; font-size: 12.5px; line-height: 1.45; }
.bubble.user { align-self: flex-end; max-width: 92%; background: #e6efe9; }
.bubble.ai { background: #fff; border: 1px solid #e5e5e5; }
.bubble.ai ul { margin: 4px 0 0; padding-left: 16px; }
.ai-input { margin-top: auto; padding: 8px 10px; border: 1px solid #d0d0d0; border-radius: 10px; background: #fff; color: #6b6b6b; font-size: 12px; }

/* Tables */
.table-scroll { overflow-x: auto; margin: 18px 0 24px; border: 1px solid var(--line); border-radius: 14px; background: #fff; }
table.info { width: 100%; border-collapse: collapse; font-size: .92rem; line-height: 1.5; }
.info th, .info td { padding: 11px 14px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.info thead th { background: #f6faf7; font-size: .8rem; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.info tr:last-child td { border-bottom: 0; }

/* APA manuscript mock */
.manuscript { max-width: 620px; margin: 22px auto 26px; padding: 36px 44px; border: 1px solid #d9d9d9; background: #fff; box-shadow: 0 16px 40px rgba(0, 0, 0, .08); font-family: "Times New Roman", Times, serif; font-size: 16px; line-height: 2; color: #111; }
.manuscript .fig-num { margin: 0; font-weight: 700; }
.manuscript .fig-title { margin: 0 0 8px; font-style: italic; }
.manuscript img { display: block; width: 100%; height: auto; margin: 6px 0; }
.manuscript .fig-note { margin: 4px 0 0; font-size: 15px; line-height: 1.6; }
.manuscript .fig-note i { font-style: italic; }

/* Template cards */
.template-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.template { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 20px; background: #fff; overflow: hidden; }
.template-preview { display: block; padding: 16px 16px 6px; border-bottom: 1px solid var(--line); background: #fff; }
.template-preview:focus-visible { outline-offset: -4px; border-radius: 19px 19px 0 0; } /* inside the card, which clips its overflow */
.template-preview img { display: block; width: 100%; height: auto; aspect-ratio: 624 / 432; object-fit: contain; }
.template-body { display: flex; flex-direction: column; gap: 8px; padding: 18px 20px 20px; flex: 1; }
.template-body h3 { margin: 0; font-size: 1.15rem; letter-spacing: -.02em; }
.template-body p { margin: 0; color: var(--muted); font-size: .92rem; line-height: 1.55; }
.template-body ul { margin: 2px 0 6px; padding-left: 1.1em; color: var(--muted); font-size: .88rem; }
.template-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: auto; padding-top: 6px; }
.download { display: inline-flex; align-items: center; gap: 8px; min-height: 42px; padding: 0 18px; border-radius: 999px; background: var(--green); color: #fff; font-weight: 650; font-size: .92rem; text-decoration: none; }
.download:hover { color: #fff; background: var(--green-dark); }
.download svg { width: 16px; height: 16px; }
.small-link { align-self: center; font-size: .9rem; font-weight: 600; }
/* The multiple baseline preview is nearly square (three stacked tiers), so beside another card it would
   stretch that card and leave a gap above its Download button. On two-column screens it takes a full row,
   preview on the left and text on the right. */
.template[data-card="mb"] .template-preview img { aspect-ratio: 629 / 622; }
@media (min-width: 641px) {
  .template[data-card="mb"] { grid-column: 1 / -1; flex-direction: row; }
  .template[data-card="mb"] .template-preview { flex: 0 0 50%; display: grid; align-items: center; padding: 16px; border-bottom: 0; border-right: 1px solid var(--line); }
  .template[data-card="mb"] .template-preview:focus-visible { border-radius: 19px 0 0 19px; }
  .template[data-card="mb"] .template-body { justify-content: center; padding: 24px 28px; }
  .template[data-card="mb"] .template-actions { margin-top: 4px; }
}

/* Pager */
.pager { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 50px; }
.pager a { display: flex; flex-direction: column; gap: 2px; padding: 16px 18px; border: 1px solid var(--line); border-radius: 14px; background: #fff; color: var(--ink); text-decoration: none; }
.pager a:hover { border-color: rgba(11, 103, 69, .45); color: var(--ink); }
.pager small { color: var(--muted); font-size: .78rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.pager .next { grid-column: 2; text-align: right; }
/* ssd.js fills the pager. Without JavaScript it stays empty, so hide it rather than leave an empty
   navigation landmark (and its top margin) at the end of the lesson. */
.pager:empty { display: none; }

.updated { margin-top: 30px; color: var(--muted); font-size: .82rem; }
footer.site { margin-top: 40px; padding: 26px 0 34px; border-top: 1px solid var(--line); color: var(--muted); font-size: .85rem; }
footer.site .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; }
footer.site a { color: var(--muted); }

/* Narrower desktop and tablet windows: shorten the header before the nav overflows. */
@media (max-width: 1100px) {
  .wordmark small { display: none; }
}
@media (max-width: 960px) {
  .hero-grid, .anatomy { grid-template-columns: 1fr; }
  .series-grid { grid-template-columns: 1fr; }
  .lesson-shell { grid-template-columns: 1fr; gap: 0; padding-top: 22px; }
  .sidebar { position: static; max-height: none; margin-bottom: 18px; padding: 12px; border: 1px solid var(--line); border-radius: 14px; background: #fff; }
  .sidebar summary { display: list-item; cursor: pointer; font-weight: 650; font-size: .95rem; }
  .sidebar details[open] summary { margin-bottom: 12px; }
  .sidebar .sidebar-title { display: none; } /* the summary already names the series */
  .sidebar:empty { display: none; } /* one column here, so an empty box would only push the lesson down */
  .pane-wrap, .ai-mock { grid-template-columns: 1fr; }
  .pane, .ai-pane { border-left: 0; border-top: 1px solid #ddd; }
}
/* Tablets and phones: the nav gets its own full-width row under the wordmark, so every link stays
   visible (beside the wordmark, the nine links would scroll out of sight below about 860px). */
@media (max-width: 860px) {
  .top .wrap { flex-wrap: wrap; column-gap: 10px; row-gap: 2px; min-height: 0; padding: 6px 0 2px; }
  .top nav { order: 3; flex: 1 0 100%; flex-wrap: wrap; justify-content: space-between; gap: 0; margin: 0 -6px; padding: 2px 0; overflow: visible; }
  .top nav a { padding: 6px; font-size: .84rem; line-height: 1.4; }
  /* The wordmark has this row to itself, so its link to the overview fits again and replaces Overview. */
  .wordmark small { display: inline; }
  .top nav a:first-child { display: none; }
  html { scroll-padding-top: var(--sticky-offset, 96px); }
}
/* Phones: the eight links take two even rows of four, and the header, now about 100px tall,
   scrolls away instead of covering the content. */
@media (max-width: 500px) {
  .top nav { display: grid; grid-template-columns: repeat(4, auto); justify-content: space-between; }
}
@media (max-width: 640px) {
  body { font-size: 16px; }
  .wrap { width: min(100% - 32px, 1120px); }
  .hero { padding: 38px 0 26px; }
  .checklist { columns: 1; }
  .compare, .template-grid, .series-list { grid-template-columns: 1fr; }
  .steps > li { padding-left: 44px; }
  .manuscript { padding: 22px 18px; }
  .pager { grid-template-columns: 1fr; }
  .pager .next { grid-column: 1; }
}
/* Phones, where the nav takes two rows, and short screens (landscape phones, desktop zoom of
   about 150% and up): let the header scroll away instead of covering content. */
@media (max-width: 500px), (max-height: 500px) {
  .top { position: static; }
  html { scroll-padding-top: var(--sticky-offset, 12px); }
}
/* The sidebar is only pinned beside the lesson on wide screens; below 961px it stays in the flow. */
@media (min-width: 961px) and (max-height: 500px) {
  .sidebar { top: 16px; max-height: calc(100vh - 32px); }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
  .button:hover, .series-card:hover, .tile:hover { transform: none; }
}
@media print {
  .top, .sidebar, .os-switch, .pager, .copy, .skip-link, .pm-actions, .dt-restart, .stage-card .controls { display: none !important; }
  .lesson-shell { display: block; }
  .objectives { border-left-width: 2px; break-inside: avoid; }
}

/* Sources */
.refs h2 { margin: 34px 0 12px; font-size: 1.35rem; letter-spacing: -.02em; }
.ref-list { margin: 0; padding: 0; list-style: none; }
.ref-list li { margin: 0 0 14px; padding: 0 0 14px 2em; text-indent: -2em; border-bottom: 1px solid var(--line); font-size: .95rem; line-height: 1.6; }
.ref-list a { overflow-wrap: anywhere; }
.ref-use { display: block; margin-top: 4px; text-indent: 0; color: var(--muted); font-size: .88rem; }
.ref-use a { word-break: normal; }

/* Self-review checklist */
.score-bar { position: sticky; top: 72px; z-index: 5; display: flex; flex-wrap: wrap; align-items: center; gap: 12px 18px; margin: 0 0 22px; padding: 12px 16px; border: 1px solid var(--line); border-radius: 14px; background: rgba(255, 255, 255, .95); }
/* Pinned bars under the header: leave room for both when jumping to an anchor or tabbing.
   (ssd.js replaces this estimate with a measured --sticky-offset.) */
html:has(.os-switch), html:has(.score-bar) { scroll-padding-top: var(--sticky-offset, 156px); }
/* ssd.js adds .unpinned when the bar would reach past a quarter of the window
   (for example, when it wraps to two rows on a short screen). */
.os-switch.unpinned, .score-bar.unpinned { position: static; }
/* Tablets, phones, and short screens: the header takes two rows (so a bar pinned 72px down would
   slide under it), or the bars wrap to several rows or fill too much of the screen. They stay at
   the top of the page instead of following the reader. The choices are remembered. */
@media (max-width: 860px), (max-height: 600px) {
  .os-switch, .score-bar { position: static; }
  html:has(.os-switch), html:has(.score-bar) { scroll-padding-top: var(--sticky-offset, 96px); }
}
@media (max-width: 500px), (max-height: 500px) {
  html:has(.os-switch), html:has(.score-bar) { scroll-padding-top: var(--sticky-offset, 12px); }
}
.score { font-size: 1.05rem; font-weight: 750; }
.score small { color: var(--muted); font-weight: 600; }
.score-bar label { display: inline-flex; align-items: center; gap: 8px; font-size: .9rem; }
.score-bar .button { min-height: 38px; padding: 0 16px; font-size: .9rem; cursor: pointer; border: 0; font-family: inherit; }
.score-bar .button-ghost { border: 1px solid #c9d6ce; } /* keep Clear's outline, as on the assignment pages */
.check-group { margin: 0 0 18px; padding: 16px 18px 6px; border: 1px solid var(--line); border-radius: 16px; background: #fff; break-inside: avoid; }
.check-group h2 { margin: 0 0 8px; font-size: 1.05rem; letter-spacing: -.01em; }
.check-group h2 small { color: var(--muted); font-weight: 600; font-size: .8rem; }
.check-item { display: grid; grid-template-columns: 26px 1fr; gap: 10px; align-items: start; padding: 8px 0; border-top: 1px solid #edf2ef; font-size: .95rem; line-height: 1.5; cursor: pointer; }
.check-item:first-of-type { border-top: 0; }
.check-item input { width: 18px; height: 18px; margin: 2px 0 0; accent-color: var(--green); }
.check-item span b { font-weight: 650; }
/* Sections that don't apply to the chosen graph (disabled fieldsets): a dashed outline on the page
   background and muted text, as for the assignment page's pending steps. No opacity, so the heading
   and its "(only if ...)" note keep 5.2:1 contrast. The !important beats each fieldset's inline border. */
.check-group.off { border-style: dashed !important; border-color: #b9c6be !important; background: var(--canvas); }
.check-group.off h2, .check-group.off .check-item { color: var(--muted); }
.check-group:disabled .check-item { cursor: default; } /* sections that don't apply to the chosen graph */
.print-only { display: none; }
@media print {
  @page { margin: .5in; }
  html, body { background: #fff !important; }
  body { font-size: 10pt; }
  .hero { padding: 0 0 6px; }
  .hero h1 { font-size: 18pt; letter-spacing: -.03em; }
  .hero .lede { margin-top: 4px; font-size: 9pt; line-height: 1.45; }
  /* Only the checklist's closing note is dropped from its one-page printout; other notes print. */
  .score-bar, footer.site, .no-print, #checklist ~ .updated { display: none !important; }
  .print-only { display: block; margin: 0 0 8px; font-size: 10pt; font-weight: 650; }
  #checklist { columns: 2; column-gap: 14px; }
  .check-group { display: block; width: 100%; padding: 6px 9px 1px; margin: 0 0 8px; border-radius: 6px; }
  .check-group h2 { margin: 0 0 2px; font-size: 10pt; }
  .check-item { grid-template-columns: 16px 1fr; gap: 6px; padding: 3px 0; font-size: 8.5pt; line-height: 1.35; }
  .check-item input { width: 11px; height: 11px; margin-top: 1px; }
  /* The paper copy is for any graph type, so every section prints the same. */
  .check-group.off { border-style: solid !important; border-color: var(--line) !important; background: #fff; }
  .check-group.off h2, .check-group.off .check-item { color: inherit; }
}
fieldset.check-group { min-width: 0; }

/* Live practice modules */
.practice { margin: 26px 0 30px; padding: 20px; border: 1px solid #c6d4cb; border-radius: 18px; background: #fff; box-shadow: 0 12px 30px rgba(23, 34, 29, .05); }
.pm-head { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 8px 16px; }
.pm-kicker { display: inline-block; margin-bottom: 2px; color: var(--green); font-size: .72rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.pm-title { margin: 0; font-size: 1.15rem; letter-spacing: -.02em; }
.pm-score { color: var(--muted); font-size: .88rem; font-weight: 600; text-align: right; }
.pm-score small { display: block; font-weight: 500; font-size: .78rem; }
.pm-mastered { display: inline-block; margin-right: 6px; padding: 2px 9px; border-radius: 999px; background: var(--green); color: #fff; font-size: .78rem; font-weight: 750; }
.pm-dots { display: flex; gap: 5px; margin: 10px 0 14px; }
.pm-dots i { width: 100%; max-width: 34px; height: 6px; border-radius: 3px; background: #e3ebe6; }
.pm-dots i.ok { background: var(--green); }
/* A missed answer is a hollow red bar (4.7:1 against the track), so it differs from the solid green
   correct bar by shape as well as hue; the two colors are almost equally dark. */
.pm-dots i.no { background: #fff; box-shadow: inset 0 0 0 2px #b3401f; }
.pm-tag { display: inline-block; margin-bottom: 8px; padding: 2px 10px; border-radius: 999px; background: #eef2f7; color: #3f5f86; font-size: .76rem; font-weight: 700; }
.pm-tag:empty { display: none; }
.pm-graph { padding: 8px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.pm-graph svg { display: block; width: 100%; max-width: 640px; height: auto; margin: 0 auto; }
.pm-table { margin: 8px 0 0; font-size: .85rem; }
.pm-table summary { cursor: pointer; color: var(--green); font-weight: 600; }
.pm-table > div { overflow-x: auto; } /* wide data tables scroll inside the widget, not the page */
.pm-data { margin-top: 6px; border-collapse: collapse; font-size: .82rem; }
.pm-data caption { padding-top: 10px; font-weight: 700; text-align: left; }
.pm-data th, .pm-data td { padding: 3px 10px 3px 0; text-align: left; vertical-align: top; }
.pm-question { margin: 16px 0 10px; font-weight: 650; }
.pm-answers { display: flex; flex-wrap: wrap; gap: 8px; }
.pm-answers button, .pm-numeric button, .pm-actions button { min-height: 42px; padding: 0 18px; border: 1px solid #c6d4cb; border-radius: 999px; background: #fff; color: var(--ink); font: 600 .92rem "Segoe UI", Helvetica, Arial, sans-serif; cursor: pointer; }
/* Long answer choices wrap on phones: vertical padding and a fixed corner radius keep a one-line
   choice a pill and turn a wrapped one into a rounded box whose text stays clear of the edges. */
.pm-answers button { padding: 8px 18px; border-radius: 21px; line-height: 1.35; text-align: left; }
.pm-answers button:hover:not(:disabled) { border-color: var(--green); background: var(--green-soft); }
.pm-answers button:disabled { cursor: default; opacity: .75; }
.pm-answers .is-right { border-color: var(--green) !important; background: var(--green-soft) !important; opacity: 1 !important; }
.pm-answers .is-wrong { border-color: #c0392b !important; background: #fde6e2 !important; opacity: 1 !important; }
/* A mark as well as a color, so right and wrong differ without relying on red vs green.
   The text after the slash is what screen readers say; browsers without it use the first line. */
.pm-answers .is-right::after { content: "\2713"; content: "\2713" / "correct answer"; margin-left: 7px; color: var(--green-dark); font-weight: 800; }
.pm-answers .is-wrong::after { content: "\2717"; content: "\2717" / "your answer, incorrect"; margin-left: 7px; color: #9b2c1c; font-weight: 800; }
.pm-numeric { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.pm-numeric input { width: 120px; min-height: 42px; margin-left: 8px; padding: 0 12px; border: 1px solid var(--field-border); border-radius: 10px; background: #fff; font: inherit; }
.pm-numeric input.is-right { border-color: var(--green); background: var(--green-soft); }
.pm-numeric input.is-wrong { border-color: #c0392b; background: #fde6e2; }
.pm-feedback p { margin: 14px 0 0; padding: 12px 14px; border-radius: 12px; font-size: .94rem; line-height: 1.55; }
/* Items with steps: each step's result opens the next step's question, in a lighter box above it. */
.pm-step .pm-question strong { white-space: nowrap; }
.pm-step-note { display: block; margin: 0 0 10px; padding: 9px 12px; border-radius: 10px; font-size: .9rem; font-weight: 500; line-height: 1.5; }
.pm-right { background: var(--green-soft); }
.pm-wrong { background: #fdf0ec; }
.pm-actions { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px; margin-top: 14px; }
.pm-actions .pm-next { border-color: var(--green); background: var(--green); color: #fff; }
.pm-actions .pm-reset { border: 0; background: none; color: var(--muted); font-size: .82rem; font-weight: 600; margin-left: auto; }
.pm-numeric button { border-color: var(--green); background: var(--green); color: #fff; }

/* Design decision tree */
.decision { margin: 22px 0 30px; padding: 22px; border: 1px solid #c6d4cb; border-radius: 18px; background: #fff; }
/* Knowledge checks (Design logic lesson): fixed questions with the practice widget's answer styles. */
.kc { margin: 22px 0 30px; padding: 20px; border: 1px solid #c6d4cb; border-radius: 18px; background: #fff; }
.kc-title { margin: 0 0 4px; font-size: 1.15rem; letter-spacing: -.02em; }
.kc-q + .kc-q { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line); }
.kc-stem { margin: 10px 0; font-weight: 650; }
.kc-choices { margin: 0; padding-left: 22px; }
.kc-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-top: 16px; }
.kc-foot:empty { display: none; }
.kc-score { margin: 0; font-weight: 700; }
.kc-again { min-height: 42px; padding: 0 18px; border: 1px solid var(--green); border-radius: 999px; background: var(--green); color: #fff; font: 600 .92rem "Segoe UI", Helvetica, Arial, sans-serif; cursor: pointer; }
.decision h3 { margin: 0 0 8px; font-size: 1.2rem; letter-spacing: -.02em; }
.dt-q { margin: 0 0 14px; font-size: 1.08rem; font-weight: 650; }
.dt-help { margin: -6px 0 14px; color: var(--muted); font-size: .92rem; }
.dt-buttons { display: flex; flex-wrap: wrap; gap: 10px; }
.dt-buttons button { min-height: 44px; padding: 0 22px; border: 1px solid #c6d4cb; border-radius: 999px; background: #fff; font: 650 .95rem "Segoe UI", Helvetica, Arial, sans-serif; cursor: pointer; }
.dt-buttons button:hover { border-color: var(--green); background: var(--green-soft); }
.dt-result { padding: 4px 0 0; }
.dt-result .eyebrow { margin-bottom: 6px; }
.dt-trail { margin: 0 0 14px; padding: 0 0 12px 1.1em; border-bottom: 1px solid var(--line); color: var(--muted); font-size: .86rem; }
.dt-trail:empty { display: none; }
.dt-restart { margin-top: 14px; border: 0; background: none; color: var(--green); font: 650 .9rem "Segoe UI", Helvetica, Arial, sans-serif; cursor: pointer; padding: 0; }

/* Control vs no-control examples */
.examples { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin: 18px 0 26px; }
.example { margin: 0; padding: 14px; border: 1px solid var(--line); border-radius: 16px; background: #fff; }
.example img { display: block; width: 100%; height: auto; }
.example figcaption { margin-top: 8px; font-size: .9rem; line-height: 1.55; }
.example.wide { grid-column: 1 / -1; }
.verdict { display: inline-block; margin-bottom: 8px; padding: 3px 10px; border-radius: 999px; font-size: .76rem; font-weight: 800; letter-spacing: .02em; }
.verdict.yes { background: var(--green-soft); color: var(--green-dark); }
.verdict.no { background: #fde6e2; color: #9b2c1c; }
.design-meta { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin: 18px 0 8px; }
.design-meta div { padding: 14px 16px; border: 1px solid var(--line); border-radius: 14px; background: #fff; font-size: .9rem; line-height: 1.5; }
.design-meta b { display: block; margin-bottom: 4px; color: var(--muted); font-size: .72rem; letter-spacing: .1em; text-transform: uppercase; }
@media (max-width: 760px) {
  .examples, .design-meta { grid-template-columns: 1fr; }
  .practice { padding: 16px; }
}


/* Overview: Graph Studio (chosen 2026-10-19, see .21st/design.json) */
.studio { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); gap: 36px; align-items: center; padding: 40px 0 34px; }
.studio h1 { font-size: clamp(2.3rem, 6vw, 4.2rem); line-height: 1; letter-spacing: -.055em; }
.studio h1 em { font-style: normal; color: var(--green); }
.studio .lede { margin: 18px 0 0; color: var(--muted); font-size: 1.1rem; max-width: 470px; }
.stage-card { padding: 16px; border-radius: 24px; background: #fff; box-shadow: 0 24px 60px rgba(23,34,29,.09); border: 1px solid var(--line); }
.controls { display: flex; flex-wrap: wrap; gap: 10px; justify-content: space-between; margin-bottom: 10px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chips button, .toggle button { min-height: 34px; padding: 0 13px; border: 1px solid #d4e0d8; border-radius: 999px; background: #fff; font: 650 .82rem "Segoe UI", Helvetica, Arial, sans-serif; cursor: pointer; color: var(--ink); }
.chips button[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: #fff; }
.toggle { display: inline-flex; padding: 3px; border-radius: 999px; background: #eef2ef; }
.toggle button { border: 0; background: transparent; }
.toggle button[aria-pressed="true"].yes { background: var(--green); color: #fff; }
.toggle button[aria-pressed="true"].no { background: #b3401f; color: #fff; }
.stage-card img { display: block; width: 100%; height: auto; border-radius: 10px; }
.verdict-line { display: flex; gap: 10px; align-items: flex-start; margin: 10px 4px 2px; font-size: .92rem; line-height: 1.5; }
.verdict-line b { flex: none; padding: 2px 9px; border-radius: 999px; font-size: .74rem; }
.verdict-line b.yes { background: var(--green-soft); color: var(--green-dark); }
.verdict-line b.no { background: #fde6e2; color: #9b2c1c; }
.entry-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); grid-auto-rows: 210px; gap: 14px; margin: 10px auto 50px; }
.tile { position: relative; overflow: hidden; display: flex; flex-direction: column; padding: 22px; border-radius: 22px; background: #fff; border: 1px solid var(--line); color: var(--ink); text-decoration: none; transition: transform .2s ease, box-shadow .2s ease; }
.tile:hover { transform: translateY(-3px); box-shadow: 0 16px 34px rgba(23,34,29,.08); color: var(--ink); }
.tile small { color: var(--green); font-weight: 800; letter-spacing: .1em; text-transform: uppercase; font-size: .7rem; }
.tile h3 { margin: 4px 0 4px; font-size: 1.3rem; letter-spacing: -.03em; }
.tile p { margin: 0; color: var(--muted); font-size: .9rem; max-width: 260px; }
/* Keep the description clear of the thumbnail in the half-width tiles (the image starts about 54% across). */
.t-analysis p, .t-designs p { max-width: min(260px, calc(54% + 8px)); }
.tile img { position: absolute; right: -24px; bottom: -18px; width: 62%; opacity: .95; border-radius: 8px; box-shadow: 0 10px 26px rgba(0,0,0,.08); }
.t-excel { grid-column: span 3; grid-row: span 2; background: linear-gradient(160deg, #f3faf6, #fff 55%); }
.t-excel img { width: 78%; right: -10px; bottom: -10px; }
.t-analysis { grid-column: span 3; background: #17221d; border-color: #17221d; color: #fff; }
.t-analysis h3 { color: #fff; } .t-analysis p { color: #b9cbc1; } .t-analysis small { color: #8ee0b5; }
.t-designs { grid-column: span 3; }
.t-sheets, .t-prism, .t-ai { grid-column: span 2; }
.t-templates, .t-check { grid-column: span 3; }
.t-ai img, .t-templates img, .t-check img { display: none; }
.t-designs img, .t-analysis img { width: 46%; }
@media (max-width: 900px) {
  .studio { grid-template-columns: 1fr; }
  .entry-grid { grid-template-columns: 1fr; grid-auto-rows: auto; }
  .tile { grid-column: auto !important; grid-row: auto !important; min-height: 170px; }
  .tile img { position: static; width: 100% !important; margin-top: 14px; box-shadow: none; }
  .t-analysis p, .t-designs p { max-width: 260px; }
  .t-ai img, .t-templates img, .t-check img { display: none; }
}
@media (prefers-reduced-motion: reduce) { .tile { transition: none; } .tile:hover { transform: none; } }


/* Graph-type picker: blocks marked data-design="key ..." show only for those graph types.
   Without a d-* class (no JavaScript), the reversal design is shown. */
html.d-ab [data-design]:not([data-design~="ab"]) { display: none !important; }
html.d-reversal [data-design]:not([data-design~="reversal"]) { display: none !important; }
html.d-mb [data-design]:not([data-design~="mb"]) { display: none !important; }
html.d-atd [data-design]:not([data-design~="atd"]) { display: none !important; }
html.d-fa [data-design]:not([data-design~="fa"]) { display: none !important; }
html.d-cc [data-design]:not([data-design~="cc"]) { display: none !important; }
html:not(.d-ab):not(.d-reversal):not(.d-mb):not(.d-atd):not(.d-fa):not(.d-cc) [data-design]:not([data-design~="reversal"]) { display: none !important; }
.design-pick { display: inline-flex; align-items: center; gap: 8px; margin-left: auto; color: var(--muted); font-size: .85rem; font-weight: 600; }
.design-pick select { min-height: 36px; padding: 0 30px 0 12px; border: 1px solid var(--field-border); border-radius: 999px; background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%2317221d' stroke-width='1.5'/%3E%3C/svg%3E") no-repeat right 12px center; color: var(--ink); font: 650 .88rem "Segoe UI", Helvetica, Arial, sans-serif; appearance: none; cursor: pointer; }
.design-pick select:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
/* Lessons that don't apply to the chosen graph: a paler, outlined number disc and a note. */
.sidebar a.skip { color: var(--muted); }
.sidebar a.skip::before { background: #eef2ef; color: var(--muted); box-shadow: inset 0 0 0 1px #b9c6be; }
/* The current lesson keeps its current-page styling even when it's marked as not needed. */
.sidebar a.skip[aria-current="page"] { color: var(--green-dark); }
.sidebar a.skip[aria-current="page"]::before { background: var(--green); color: #fff; box-shadow: none; }
.skip-note { display: block; margin-top: 2px; color: var(--muted); font-size: .74rem; font-weight: 600; font-style: italic; }
.design-note { margin: 0 0 22px; padding: 12px 16px; border-radius: 12px; background: #eef2f7; font-size: .92rem; }
@media (max-width: 640px) { .design-pick { margin-left: 0; width: 100%; } .design-pick select { flex: 1; } }

/* Class assignments (student and teacher pages) */
.as-page { max-width: 900px; padding-bottom: 40px; }
.as-step { position: relative; margin: 0 0 18px; padding: 22px 22px 22px 70px; border: 1px solid var(--line); border-radius: 18px; background: #fff; }
.as-step > .as-num { position: absolute; left: 20px; top: 20px; width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; background: var(--green); color: #fff; font-weight: 800; }
.as-step h2 { margin: 2px 0 6px; font-size: 1.25rem; letter-spacing: -.02em; }
.as-step p { margin: 0 0 10px; }
/* A step that isn't open yet (data-pending, a visual state only: its links and fields still work).
   A dashed outline on the page background and a hollow number. No opacity, so the text keeps its
   contrast: the body text stays ink, and the muted heading and number are 5.2:1 on the page
   background and 5.6:1 on white. */
.as-step[data-pending] { border-style: dashed; border-color: #b9c6be; background: var(--canvas); }
.as-step[data-pending] > .as-num { background: #fff; color: var(--muted); box-shadow: inset 0 0 0 2px #b9c6be; }
.as-step[data-pending] h2 { color: var(--muted); }
.as-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 16px; margin: 10px 0 14px; }
.as-field label, .as-field > span { display: block; margin-bottom: 4px; font-size: .88rem; font-weight: 650; }
.as-field input[type="text"], .as-field input:not([type]), .as-field select, .as-field textarea { width: 100%; min-height: 42px; padding: 8px 12px; border: 1px solid var(--field-border); border-radius: 10px; background: #fff; font: inherit; }
.as-field textarea { min-height: 170px; line-height: 1.55; resize: vertical; }
.as-field small { display: block; margin-top: 4px; color: var(--muted); font-size: .8rem; }
.as-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 8px; }
.as-actions .button { min-height: 42px; padding: 0 18px; font-size: .92rem; border: 0; cursor: pointer; font-family: inherit; }
.as-actions .button-ghost { border: 1px solid #c9d6ce; }
.as-status { color: var(--muted); font-size: .88rem; }
.as-q { margin: 0 0 16px; padding: 0; border: 0; }
.as-q legend { margin-bottom: 6px; font-weight: 650; }
.as-q label { display: flex; gap: 10px; align-items: flex-start; margin: 4px 0; padding: 8px 12px; border: 1px solid #dfe7e2; border-radius: 10px; cursor: pointer; }
.as-q label:hover { border-color: var(--green); }
.as-q input { margin-top: 4px; accent-color: var(--green); }
.as-graph-preview { margin-top: 12px; padding: 10px; border: 1px dashed #c6d4cb; border-radius: 12px; text-align: center; }
.as-graph-preview img { max-width: 100%; height: auto; }
.as-code { display: inline-block; padding: 6px 12px; border-radius: 10px; background: var(--gold-soft); font: 700 1.25rem Consolas, "SF Mono", Menlo, monospace; letter-spacing: .06em; }
.as-link { display: block; margin: 6px 0; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: #f8fbf9; font: .85rem Consolas, "SF Mono", Menlo, monospace; word-break: break-all; }
.as-error { color: #9b2c1c; font-weight: 650; }
.as-ok { color: var(--green-dark); font-weight: 650; }
/* The answer key: one block per student. The student ID, graph type and data link run across the top,
   and the correct answers sit beside (on narrower screens, above) an expected graph drawn large enough
   to read its values and labels. It stays a table for screen readers: the column headings are only
   visually hidden, and the small labels each block shows are left out of the spoken text.
   Cells by position, as assignment-teacher.js builds each row: 1 student ID (th), 2 graph type,
   3 correct answers, 4 expected graph, 5 data link. */
.as-key, .as-key tbody { display: block; }
.as-key thead { display: block; position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.as-key tbody tr { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: start; gap: 8px 16px; padding: 14px; border-bottom: 1px solid var(--line); }
.as-key tbody tr:last-child { border-bottom: 0; }
.as-key tbody th, .as-key tbody td { display: block; padding: 0; border: 0; }
.as-key th[scope="row"] { grid-area: 1 / 1; font-size: 1rem; overflow-wrap: anywhere; }
.as-key td:nth-child(2) { grid-area: 1 / 2; color: var(--muted); font-weight: 650; }
.as-key td:nth-child(3) { grid-area: 2 / 1 / auto / -1; }
.as-key td:nth-child(4) { grid-area: 3 / 1 / auto / -1; }
.as-key td:nth-child(5) { grid-area: 1 / 3; justify-self: end; }
.as-key td:nth-child(3)::before, .as-key td:nth-child(4)::before { display: block; margin-bottom: 4px; color: var(--muted); font-size: .72rem; font-weight: 750; letter-spacing: .08em; text-transform: uppercase; }
.as-key td:nth-child(3)::before { content: "Correct answers"; content: "Correct answers" / ""; }
.as-key td:nth-child(4)::before { content: "Expected graph"; content: "Expected graph" / ""; }
.as-key td svg { display: block; width: 100%; max-width: 560px; height: auto; }
@media (min-width: 900px) {
  .as-key tbody tr { grid-template-columns: auto minmax(0, 1fr) 400px; }
  .as-key td:nth-child(3) { grid-area: 2 / 1 / auto / 3; }
  .as-key td:nth-child(4) { grid-area: 2 / 3; }
}

/* The printable submission report */
.report { margin: 26px 0; padding: 30px 34px; border: 1px solid #cfcfcf; background: #fff; box-shadow: 0 16px 40px rgba(0, 0, 0, .06); }
.report header { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 20px; padding-bottom: 12px; border-bottom: 2px solid var(--ink); }
.report h2 { margin: 0; font-size: 1.35rem; letter-spacing: -.02em; }
.report h3 { margin: 22px 0 8px; font-size: 1.02rem; }
.report dl { display: grid; grid-template-columns: max-content 1fr; gap: 2px 14px; margin: 12px 0 0; font-size: .92rem; }
.report dt { color: var(--muted); }
.report dd { margin: 0; font-weight: 600; }
.report .rep-graph img { display: block; max-width: 100%; max-height: 520px; margin: 0 auto; }
.report .rep-graph svg { display: block; width: 100%; max-width: 624px; height: auto; margin: 0 auto; } /* the reference graph shrinks to fit a phone */
.report table.sheet { font-size: 11px; }
.report .rep-answer { margin: 0 0 10px; }
.report .rep-answer b { display: block; }
.report .rep-key { color: var(--green-dark); font-size: .9rem; }
.report .rep-key.wrong { color: #9b2c1c; }
.report blockquote { margin: 0; padding: 10px 14px; border-left: 3px solid var(--line); white-space: pre-wrap; }
.report .rep-receipt { margin-top: 20px; padding: 12px 14px; border: 2px dashed var(--ink); font: 700 1.1rem Consolas, "SF Mono", Menlo, monospace; text-align: center; }
/* The graph self-check: each item already starts with a checked or empty box, so no bullet, and wrapped
   lines line up under the text rather than under the box. */
.report .rep-checks { padding-left: 0; list-style: none; }
.report .rep-checks li { padding-left: 1.4em; text-indent: -1.4em; }
@media print {
  /* Print only the report, whatever page it is on. Everything else is removed from the layout (not
     just made invisible, which keeps its height and adds blank pages), and the report's ancestors
     lose their own boxes, so the report starts at the top of the first page. */
  body.print-report *:not(:has(.report)):not(.report):not(.report *) { display: none !important; }
  body.print-report :has(.report) { display: block !important; position: static !important; width: auto !important; max-width: none !important; margin: 0 !important; padding: 0 !important; border: 0 !important; box-shadow: none !important; background: none !important; }
  body.print-report .report { position: static; width: auto; margin: 0; padding: 0; border: 0; box-shadow: none; overflow: visible; }
  /* Paper can't scroll: the data sheet fits the page width, and its long column headings wrap. */
  .report .sheet-scroll { width: fit-content; max-width: 100%; overflow: visible; box-shadow: none; }
  .report table.sheet th, .report table.sheet td { min-width: 0; white-space: normal; }
  .report h3 { break-after: avoid; }
  /* Keep a graph and the data sheet whole. The answer key's long table breaks between rows. */
  .report .rep-graph, .report table.sheet { break-inside: avoid; }
  /* The printed answer key: each student's block stays on one page, with the correct answers beside an
     expected graph 4.6 in wide, large enough to grade from (its 13 px text prints at about 7 pt).
     The column headings and the CSV link (no use on paper) are left out. */
  .report table.as-key { font-size: 9pt; line-height: 1.4; }
  .report .as-key thead, .report .as-key td:nth-child(5) { display: none; }
  .report .as-key tbody tr { grid-template-columns: auto minmax(0, 1fr) 4.6in; gap: 4pt .2in; padding: 9pt 0 6pt; border-top: 1px solid #8a948f; border-bottom: 0; break-inside: avoid; }
  .report .as-key th[scope="row"] { font-size: 11pt; }
  .report .as-key td:nth-child(2) { grid-column: 2 / -1; color: inherit; }
  .report .as-key td:nth-child(3) { grid-area: 2 / 1 / auto / 3; }
  .report .as-key td:nth-child(3) p { font-size: 8.5pt !important; } /* the script sets rem sizes inline */
  .report .as-key td:nth-child(4) { grid-area: 2 / 3; }
  .report .as-key td svg { max-width: none; }
}
@media (max-width: 640px) {
  .as-step { padding: 18px 16px 18px 16px; }
  .as-step > .as-num { position: static; margin-bottom: 8px; }
  .as-fields { grid-template-columns: 1fr; }
  .report { padding: 20px 16px; }
}

.t-teach { grid-column: span 6; background: var(--gold-soft); border-color: #f0dfae; }
.t-teach small { color: #8a6100; }
.t-teach p { max-width: 640px; }
@media (max-width: 900px) { .t-teach { grid-column: auto; } }

.template.is-yours { border-color: var(--green); box-shadow: 0 0 0 3px rgba(11, 103, 69, .18); }
/* The text after the slash is what screen readers add to the heading's name ("..., your graph");
   browsers without it use the first line. */
.template.is-yours .template-body h3::after { content: "Your graph"; content: "Your graph" / ", your graph"; margin-left: 10px; padding: 2px 9px; border-radius: 999px; background: var(--green); color: #fff; font-size: .72rem; font-weight: 750; vertical-align: middle; }

.sheet td.p5 { background: #fdeef0; }
.steps > li.last-visible::after { display: none; }
.hero .design-note { margin-top: 24px; }
/* Without JavaScript there is no picker; keep the note only where a <noscript> fallback names the graph. */
html:not(.js) .design-note:has([data-design-picker]):not(:has(noscript)) { display: none; }
.sidebar a.skip { display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: 0 10px; }
.sidebar a.skip .skip-note { grid-column: 2; padding-left: 0; margin-top: 0; }

/* Skip link */
.skip-link { position: absolute; left: 12px; top: -60px; z-index: 100; padding: 10px 16px; border-radius: 10px; background: var(--ink); color: #fff; font-weight: 700; text-decoration: none; }
.skip-link:focus { top: 12px; color: #fff; }

/* Windows High Contrast and other forced-color modes drop background fills, so selected
   states and the prompt marks need a system color or a border to stay visible. */
@media (forced-colors: active) {
  :focus-visible { outline-color: Highlight; }
  .seg button, .toggle button { border: 1px solid ButtonText; }
  .seg button[aria-pressed="true"],
  .chips button[aria-pressed="true"],
  .toggle button[aria-pressed="true"],
  .top nav a[aria-current="page"],
  .sidebar a[aria-current="page"],
  .sidebar a.skip[aria-current="page"] { forced-color-adjust: none; background: Highlight; color: HighlightText; border-color: Highlight; }
  .pm-answers .is-right, .pm-answers .is-wrong { border-width: 3px; }
  .pm-step-note { border: 1px solid CanvasText; }
  .prompt pre mark, mark.edit { forced-color-adjust: none; background: Mark; color: MarkText; text-decoration-color: MarkText; }
  .prompt pre mark::before, .prompt pre mark::after, mark.edit::before, mark.edit::after { color: MarkText; }
}
