/* Johdatus määrälliseen tutkimukseen: yhteinen tyylitiedosto */

:root {
  --bg: #f8f7f3;
  --surface: #ffffff;
  --surface-2: #f1efe9;
  --text: #1c1f24;
  --muted: #5a616c;
  --border: #e2ded4;
  --accent: #1d6b74;
  --accent-strong: #145159;
  --accent-weak: #e2f0f0;
  --on-accent: #ffffff;
  --ok: #2a7a4b;
  --ok-weak: #e5f3ea;
  --bad: #b23c2a;
  --bad-weak: #fbe8e4;
  --warn: #8a5d00;
  --warn-weak: #fbf1d9;
  --mean: #c2410c;
  --median: #2563eb;
  --dot: #1d6b74;
  --shadow: 0 1px 2px rgba(20, 20, 20, .05), 0 4px 16px rgba(20, 20, 20, .04);
  --radius: 12px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-head: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --font-mono: ui-monospace, "Cascadia Mono", "SF Mono", Consolas, monospace;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #121417;
    --surface: #1a1d22;
    --surface-2: #23272d;
    --text: #e6e8eb;
    --muted: #9aa2ad;
    --border: #2f343c;
    --accent: #5bb8c1;
    --accent-strong: #84ced5;
    --accent-weak: #18343a;
    --on-accent: #0b1a1c;
    --ok: #5cc48a;
    --ok-weak: #163222;
    --bad: #f0806d;
    --bad-weak: #3a1d18;
    --warn: #e2b44f;
    --warn-weak: #33290f;
    --mean: #fb8a4c;
    --median: #7aa7ff;
    --dot: #5bb8c1;
    --shadow: none;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #121417;
  --surface: #1a1d22;
  --surface-2: #23272d;
  --text: #e6e8eb;
  --muted: #9aa2ad;
  --border: #2f343c;
  --accent: #5bb8c1;
  --accent-strong: #84ced5;
  --accent-weak: #18343a;
  --on-accent: #0b1a1c;
  --ok: #5cc48a;
  --ok-weak: #163222;
  --bad: #f0806d;
  --bad-weak: #3a1d18;
  --warn: #e2b44f;
  --warn-weak: #33290f;
  --mean: #fb8a4c;
  --median: #7aa7ff;
  --dot: #5bb8c1;
  --shadow: none;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 76px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.6;
}
img, svg { max-width: 100%; }
a { color: var(--accent); text-underline-offset: 2px; }
a:hover { color: var(--accent-strong); }
h1, h2, h3 { font-family: var(--font-head); line-height: 1.2; font-weight: 600; letter-spacing: -.01em; }
h1 { font-size: clamp(1.9rem, 4.5vw, 2.7rem); margin: 0 0 .5rem; }
h2 { font-size: 1.65rem; margin: 2.8rem 0 .8rem; }
h3 { font-size: 1.2rem; margin: 1.8rem 0 .5rem; }
p { margin: 0 0 1rem; }
ul, ol { padding-left: 1.3rem; margin: 0 0 1rem; }
li { margin-bottom: .3rem; }
code, .mono { font-family: var(--font-mono); font-size: .9em; }
:not(pre) > code { background: var(--surface-2); padding: .1em .35em; border-radius: 5px; }
pre {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: .9rem 1rem;
  overflow-x: auto;
  font-size: .88rem;
  line-height: 1.5;
  margin: 0 0 1rem;
}
hr { border: 0; border-top: 1px solid var(--border); margin: 2rem 0; }
.muted { color: var(--muted); }
.small { font-size: .88rem; }
.nowrap { white-space: nowrap; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Yläpalkki */
.topbar {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(8px);
  -webkit-backdrop-filter: saturate(1.4) blur(8px);
  border-bottom: 1px solid var(--border);
}
.topbar-inner {
  max-width: 1180px; margin: 0 auto; padding: .7rem 16px;
  display: flex; align-items: center; gap: 1rem; justify-content: space-between;
}
.brand { display: flex; align-items: center; gap: .6rem; text-decoration: none; color: var(--text); font-weight: 600; }
.brand:hover { color: var(--text); }
.brand-mark {
  width: 30px; height: 30px; border-radius: 8px; background: var(--accent);
  display: grid; place-items: center; flex: none;
}
.brand-mark svg { width: 18px; height: 18px; }
.brand-text { font-size: .98rem; line-height: 1.2; }
.topbar-nav { display: flex; gap: .3rem; align-items: center; }
.topbar-nav a {
  text-decoration: none; color: var(--muted); font-size: .92rem;
  padding: .35rem .6rem; border-radius: 8px;
}
.topbar-nav a:hover, .topbar-nav a[aria-current="page"] { color: var(--text); background: var(--surface-2); }
@media (max-width: 560px) {
  .brand-text { display: none; }
}

/* Asettelu */
.wrap { max-width: 1180px; margin: 0 auto; padding: 0 16px; }
.narrow { max-width: 760px; margin: 0 auto; padding: 0 16px; }
.layout {
  max-width: 1180px; margin: 0 auto; padding: 0 16px;
  display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 3rem;
}
.content { max-width: 760px; min-width: 0; padding-bottom: 4rem; }
@media (max-width: 960px) {
  .layout { grid-template-columns: minmax(0, 1fr); gap: 0; }
}

/* Sisällysluettelo */
.toc { position: sticky; top: 76px; align-self: start; padding: 2rem 0; max-height: calc(100vh - 76px); overflow-y: auto; }
.toc-title { font-size: .78rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin-bottom: .6rem; font-weight: 600; }
.toc ol { list-style: none; padding: 0; margin: 0; }
.toc li { margin: 0; }
.toc a {
  display: flex; gap: .55rem; align-items: flex-start;
  text-decoration: none; color: var(--muted); font-size: .9rem; line-height: 1.35;
  padding: .42rem .5rem; border-radius: 8px;
}
.toc a:hover { background: var(--surface-2); color: var(--text); }
.toc a.active { color: var(--text); background: var(--surface-2); font-weight: 600; }
.toc .tick {
  flex: none; width: 18px; height: 18px; border-radius: 50%; margin-top: 1px;
  border: 1.5px solid var(--border); display: grid; place-items: center; font-size: 11px; color: transparent;
}
.toc .done .tick { background: var(--ok); border-color: var(--ok); color: var(--on-accent); }
.toc-progress { margin-top: 1rem; font-size: .82rem; color: var(--muted); }
.bar { height: 6px; border-radius: 99px; background: var(--surface-2); overflow: hidden; margin-top: .35rem; }
.bar > span { display: block; height: 100%; background: var(--accent); border-radius: 99px; transition: width .4s ease; }
@media (max-width: 960px) {
  .toc { position: static; max-height: none; padding: 1rem 0 0; }
  .toc details { border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); padding: .6rem .8rem; }
  .toc summary { cursor: pointer; font-weight: 600; font-size: .95rem; }
}
@media (min-width: 961px) {
  .toc summary { display: none; }
}

/* Moduulin otsikko */
.module-head { padding: 2.5rem 0 1rem; }
.eyebrow { font-size: .8rem; text-transform: uppercase; letter-spacing: .09em; color: var(--accent); font-weight: 700; margin-bottom: .5rem; }
.lead { font-size: 1.12rem; color: var(--muted); max-width: 62ch; }
.goals {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1rem 1.2rem; margin: 1.5rem 0 0; box-shadow: var(--shadow);
}
.goals h3 { margin: 0 0 .5rem; font-size: 1rem; font-family: var(--font); }
.goals ul { margin: 0; }

section.sec { padding-top: .5rem; }
.sec-num { color: var(--muted); font-weight: 500; margin-right: .3rem; }

/* Laatikot */
.callout {
  border-radius: var(--radius); padding: .9rem 1.1rem; margin: 1.2rem 0;
  border: 1px solid var(--border); background: var(--surface);
}
.callout > :last-child { margin-bottom: 0; }
.callout-title { font-weight: 700; margin-bottom: .3rem; display: block; }
.callout.tip { background: var(--accent-weak); border-color: transparent; }
.callout.warn { background: var(--warn-weak); border-color: transparent; }
.callout.key { border-left: 4px solid var(--accent); }

.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1.1rem 1.2rem; box-shadow: var(--shadow);
}

/* Mittaustasojen tikapuut */
.ladder { display: grid; gap: .6rem; margin: 1.2rem 0 1.5rem; }
.rung {
  display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: .9rem;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1rem 1.1rem; box-shadow: var(--shadow);
}
.rung-step {
  width: 44px; height: 44px; border-radius: 10px; display: grid; place-items: center;
  font-weight: 700; color: var(--on-accent); background: var(--accent); font-size: 1.1rem;
}
.rung:nth-child(1) .rung-step { opacity: .55; }
.rung:nth-child(2) .rung-step { opacity: .7; }
.rung:nth-child(3) .rung-step { opacity: .85; }
.rung h3 { margin: 0 0 .25rem; font-size: 1.12rem; }
.rung p { margin: 0 0 .4rem; }
.rung .ops { display: flex; flex-wrap: wrap; gap: .35rem; margin-top: .35rem; }
.chip {
  display: inline-flex; align-items: center; gap: .3rem;
  font-size: .8rem; padding: .15rem .55rem; border-radius: 99px;
  background: var(--surface-2); color: var(--text); border: 1px solid var(--border);
}
.chip.new { background: var(--accent-weak); border-color: transparent; font-weight: 600; }

/* Taulukot */
.table-wrap { overflow-x: auto; margin: 1rem 0 1.4rem; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
table { border-collapse: collapse; width: 100%; font-size: .93rem; }
th, td { padding: .5rem .75rem; text-align: left; border-bottom: 1px solid var(--border); white-space: nowrap; }
thead th { background: var(--surface-2); font-weight: 600; font-size: .85rem; }
tbody tr:last-child td, tfoot tr:last-child td { border-bottom: 0; }
tfoot td { font-weight: 600; background: var(--surface-2); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
td.yes { color: var(--ok); font-weight: 700; }
td.no { color: var(--muted); }
td.wrap, th.wrap { white-space: normal; }

/* Kaavat */
.formula {
  font-family: var(--font-head); font-size: 1.15rem; text-align: center;
  padding: .8rem 1rem; margin: 1rem 0; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  overflow-x: auto;
}
.frac { display: inline-flex; flex-direction: column; vertical-align: middle; text-align: center; margin: 0 .2em; }
.frac > span:first-child { border-bottom: 1.5px solid currentColor; padding: 0 .3em .1em; }
.frac > span:last-child { padding: .1em .3em 0; }
.sqrt { white-space: nowrap; }
.sqrt > .rad { border-top: 1.5px solid currentColor; padding: 0 .15em; display: inline-block; }

/* Painikkeet */
.btn {
  appearance: none; border: 1px solid transparent; background: var(--accent); color: var(--on-accent);
  font: inherit; font-size: .93rem; font-weight: 600; padding: .55rem 1rem; border-radius: 9px;
  cursor: pointer; display: inline-flex; align-items: center; gap: .4rem; text-decoration: none; line-height: 1.2;
}
.btn:hover { background: var(--accent-strong); color: var(--on-accent); }
.btn:focus-visible, .choice:focus-within, .ghost:focus-visible, button:focus-visible, input:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.ghost {
  appearance: none; font: inherit; font-size: .9rem; cursor: pointer;
  background: var(--surface); color: var(--text); border: 1px solid var(--border);
  padding: .5rem .85rem; border-radius: 9px; display: inline-flex; align-items: center; gap: .35rem; line-height: 1.2;
}
.ghost:hover { background: var(--surface-2); }
.ghost.sm, .btn.sm { padding: .35rem .65rem; font-size: .84rem; }
.btn-row { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin-top: .8rem; }

/* Tehtävät ja demot */
.exercise, .demo {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  margin: 1.6rem 0; box-shadow: var(--shadow); overflow: hidden;
}
.ex-head {
  display: flex; align-items: center; justify-content: space-between; gap: .8rem; flex-wrap: wrap;
  padding: .75rem 1.1rem; border-bottom: 1px solid var(--border); background: var(--surface-2);
}
.ex-label { font-size: .78rem; text-transform: uppercase; letter-spacing: .08em; font-weight: 700; color: var(--accent); }
.ex-title { font-weight: 650; font-size: 1rem; margin: 0; font-family: var(--font); }
.ex-body { padding: 1.1rem; }
.ex-body > :last-child { margin-bottom: 0; }
.ex-score { font-size: .85rem; color: var(--muted); }

/* Kysymykset */
.q { padding: 1rem 0; border-bottom: 1px dashed var(--border); }
.q:first-child { padding-top: 0; }
.q:last-child { border-bottom: 0; padding-bottom: 0; }
.q-num { font-weight: 700; color: var(--muted); margin-right: .25rem; }
.q-prompt { margin-bottom: .65rem; }
.q-prompt p:last-child { margin-bottom: 0; }
.choices { display: grid; gap: .45rem; }
.choice {
  display: flex; gap: .65rem; align-items: flex-start; cursor: pointer;
  padding: .6rem .8rem; border: 1px solid var(--border); border-radius: 10px; background: var(--surface);
  transition: border-color .15s, background .15s;
}
.choice:hover { border-color: var(--accent); }
.choice input { margin: .3rem 0 0; accent-color: var(--accent); flex: none; }
.choice.sel { border-color: var(--accent); background: var(--accent-weak); }
.choice.right { border-color: var(--ok); background: var(--ok-weak); }
.choice.wrong { border-color: var(--bad); background: var(--bad-weak); }
.locked .choice { cursor: default; }
.num-input { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.num-input input {
  font: inherit; width: 9rem; padding: .5rem .7rem; border-radius: 9px;
  border: 1px solid var(--border); background: var(--surface); color: var(--text);
  font-variant-numeric: tabular-nums;
}
.num-input input.right { border-color: var(--ok); background: var(--ok-weak); }
.num-input input.wrong { border-color: var(--bad); background: var(--bad-weak); }
.feedback { margin-top: .7rem; padding: .7rem .9rem; border-radius: 10px; font-size: .95rem; }
.feedback:empty { display: none; }
.feedback.ok { background: var(--ok-weak); }
.feedback.bad { background: var(--bad-weak); }
.feedback.info { background: var(--surface-2); }
.feedback strong.verdict { display: block; margin-bottom: .2rem; }
.feedback.ok strong.verdict { color: var(--ok); }
.feedback.bad strong.verdict { color: var(--bad); }
.feedback > :last-child { margin-bottom: 0; }
.solution { margin-top: .5rem; }
.q-intro {
  background: var(--surface-2); border-radius: 10px; padding: .8rem 1rem; margin: 1.2rem 0 .4rem;
}
.q-intro > :last-child { margin-bottom: 0; }

/* Luokittelutehtävä */
.classify-row { padding: .8rem 0; border-bottom: 1px dashed var(--border); }
.classify-row:last-child { border-bottom: 0; }
.classify-item { font-weight: 600; margin-bottom: .45rem; }
.seg { display: flex; flex-wrap: wrap; gap: .35rem; }
.seg button {
  appearance: none; font: inherit; font-size: .86rem; cursor: pointer;
  padding: .35rem .7rem; border-radius: 99px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text);
}
.seg button:hover:not([disabled]) { border-color: var(--accent); }
.seg button.right { background: var(--ok); border-color: var(--ok); color: var(--on-accent); }
.seg button.wrong { background: var(--bad-weak); border-color: var(--bad); color: var(--bad); text-decoration: line-through; }
.seg button[disabled] { cursor: default; }
.classify-explain { font-size: .92rem; color: var(--muted); margin-top: .45rem; }
.classify-explain:empty { display: none; }

/* Tunnuslukupaneeli */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: .5rem; margin: .8rem 0; }
.stat {
  background: var(--surface-2); border-radius: 10px; padding: .55rem .75rem;
}
.stat .label { font-size: .76rem; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; display: flex; align-items: center; gap: .35rem; }
.stat .value { font-size: 1.3rem; font-weight: 650; font-variant-numeric: tabular-nums; }
.swatch { width: 10px; height: 10px; border-radius: 2px; display: inline-block; }
.swatch.mean { background: var(--mean); }
.swatch.median { background: var(--median); }

/* Pistekuvio */
.dotplot { width: 100%; height: auto; display: block; touch-action: none; user-select: none; -webkit-user-select: none; }
.dotplot .axis { stroke: var(--muted); stroke-width: 1; }
.dotplot .tick-label { fill: var(--muted); font-size: 11px; font-family: var(--font); }
.dotplot .pt { fill: var(--dot); stroke: var(--surface); stroke-width: 2; cursor: grab; }
.dotplot .pt:focus { outline: none; stroke: var(--text); stroke-width: 2.5; }
.dotplot .pt.drag { cursor: grabbing; fill: var(--accent-strong); }
.dotplot .mean-line { stroke: var(--mean); stroke-width: 2; stroke-dasharray: 5 4; }
.dotplot .median-line { stroke: var(--median); stroke-width: 2; }
.dotplot .mean-label { fill: var(--mean); font-size: 12px; font-weight: 700; font-family: var(--font); }
.dotplot .median-label { fill: var(--median); font-size: 12px; font-weight: 700; font-family: var(--font); }
.dotplot .box { fill: var(--accent-weak); stroke: var(--muted); stroke-width: 1.2; }
.dotplot .whisker { stroke: var(--muted); stroke-width: 1.2; }
.dotplot .box-median { stroke: var(--median); stroke-width: 2.5; }
.dotplot .box-label { fill: var(--muted); font-size: 11px; font-family: var(--font); }
.dotplot.narrow .tick-label { font-size: 13px; }
.dotplot.narrow .mean-label, .dotplot.narrow .median-label { font-size: 15px; }
@media (max-width: 560px) {
  .stat-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .4rem; }
  .stat { padding: .45rem .55rem; }
  .stat .label { font-size: .68rem; letter-spacing: .02em; }
  .stat .value { font-size: 1.1rem; }
}
.demo-note {
  font-size: .95rem; padding: .7rem .9rem; border-radius: 10px; background: var(--surface-2); margin-top: .6rem;
}

/* Koe */
.exam-summary {
  display: flex; gap: 1.2rem; align-items: center; flex-wrap: wrap;
  padding: 1rem 1.1rem; border-radius: var(--radius); margin-bottom: 1rem;
}
.exam-summary.pass { background: var(--ok-weak); }
.exam-summary.fail { background: var(--warn-weak); }
.exam-score { font-size: 2.2rem; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1; }
.exam-warn { color: var(--bad); font-size: .9rem; }

/* Etusivu */
.hero { padding: 3rem 0 1.5rem; }
.hero .lead { margin-bottom: 1.4rem; }
.notice { font-size: .88rem; color: var(--muted); }
.start-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1rem; margin: 1.5rem 0 1rem; }
.start-card { display: flex; flex-direction: column; gap: .4rem; }
.start-card h3 { margin: 0; }
.start-card p { margin: 0; color: var(--muted); font-size: .95rem; flex: 1; }
.part { margin: 2.5rem 0 1rem; }
.part-head { display: flex; align-items: baseline; gap: .7rem; flex-wrap: wrap; margin-bottom: .3rem; }
.part-head h2 { margin: 0; }
.modules { display: grid; gap: .6rem; margin-top: 1rem; }
.mod {
  display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; gap: .9rem; align-items: center;
  padding: .85rem 1rem; border-radius: var(--radius); border: 1px solid var(--border); background: var(--surface);
  text-decoration: none; color: var(--text);
}
a.mod:hover { border-color: var(--accent); color: var(--text); }
.mod.soon { opacity: .62; background: transparent; box-shadow: none; }
.mod-num {
  width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center;
  background: var(--surface-2); font-weight: 700; color: var(--muted);
}
a.mod .mod-num { background: var(--accent); color: var(--on-accent); }
.mod-title { font-weight: 600; }
.mod-desc { font-size: .88rem; color: var(--muted); }
.mod-status { font-size: .8rem; color: var(--muted); text-align: right; white-space: nowrap; }
.mod-status .bar { width: 90px; margin-left: auto; }
@media (max-width: 560px) {
  .mod { grid-template-columns: 36px minmax(0, 1fr); }
  .mod-status { grid-column: 2; text-align: left; }
  .mod-status .bar { margin-left: 0; }
}

/* Tasotesti */
.result-table td:last-child { white-space: normal; }
.badge { display: inline-block; font-size: .78rem; font-weight: 700; padding: .12rem .5rem; border-radius: 99px; }
.badge.ok { background: var(--ok-weak); color: var(--ok); }
.badge.bad { background: var(--bad-weak); color: var(--bad); }
.badge.mid { background: var(--warn-weak); color: var(--warn); }

/* Alatunniste */
.footer { border-top: 1px solid var(--border); margin-top: 3rem; padding: 1.5rem 0 2.5rem; font-size: .85rem; color: var(--muted); }
.footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .8rem 2rem; }

/* Teeman vaihto */
.theme-toggle { appearance: none; border: 1px solid var(--border); background: var(--surface); color: var(--text); border-radius: 8px; width: 34px; height: 34px; cursor: pointer; display: grid; place-items: center; }
.theme-toggle svg { width: 17px; height: 17px; }

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}
@media print {
  .topbar, .toc, .btn-row, .footer { display: none; }
  .layout { display: block; }
}

/* Jakauman muoto -kuvat */
.shapes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .6rem; margin: 1rem 0 1.4rem; }
.shape { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: .6rem .6rem .5rem; text-align: center; }
.shape svg { width: 100%; height: auto; display: block; }
.shape-curve { fill: var(--accent-weak); stroke: var(--accent); stroke-width: 2; }
.shape-mean { stroke: var(--mean); stroke-width: 2; stroke-dasharray: 4 3; }
.shape-median { stroke: var(--median); stroke-width: 2; }
.shape-base { stroke: var(--muted); stroke-width: 1; }
.shape-cap { font-size: .85rem; font-weight: 600; margin-top: .3rem; }
.shape-sub { font-size: .78rem; color: var(--muted); }
.legend { display: flex; flex-wrap: wrap; gap: 1rem; font-size: .85rem; color: var(--muted); margin: .3rem 0 0; }
.legend span { display: inline-flex; align-items: center; gap: .35rem; }
.legend .ln { width: 18px; height: 0; border-top: 2px solid var(--median); display: inline-block; }
.legend .ln.mean { border-top: 2px dashed var(--mean); }
@media (max-width: 560px) { .shapes { grid-template-columns: minmax(0, 1fr); } .shape svg { max-width: 260px; margin: 0 auto; } }
