/* HFE design review: canvas rules only. Every selector starts with .canvas-hfe (set on <main>).
   Tokens, fonts, header, footer, buttons, chips and cards come from /lab/lab.css. No colour literal here.
   Checked by tests/lab/check_shell.py (b and b2). */
.canvas-hfe { --ring: var(--lab-ring); --mm-canvas: var(--lab-ink); --mm-cream: var(--lab-cream); --mm-teal: var(--lab-teal); --mm-teal-bright: var(--lab-teal-d);
  --mm-teal-wash: var(--lab-wash);
  --mm-card-white: var(--lab-white); --mm-hair-light: var(--lab-hair);
  --mm-font-display: var(--lab-display); --mm-font-label: var(--lab-ui);
  --mm-radius-card: 14px; --mm-radius-dialog: 14px; --mm-radius-small: 6px; --mm-radius-pill: 14px;
  --bg: var(--mm-cream); --on-ink: var(--mm-cream);
  --card: var(--mm-card-white); --strip: var(--mm-cream); --hair: var(--mm-hair-light);
  --link: var(--ink); --link-line: var(--mm-teal);
  --pad: 32px; --gap: 56px; --card-gap: 26px; }
.canvas-hfe { font: 500 18px/1.5 var(--mm-font-display); }
.canvas-hfe ::selection { background: var(--mm-teal); color: var(--mm-cream); }
.canvas-hfe { width: 100%; max-width: calc(1200px + 2 * var(--lab-m)); margin: 0 auto; padding-left: var(--lab-m); padding-right: var(--lab-m); }
.canvas-hfe { flex: 1 0 auto; padding-bottom: var(--gap); }
.canvas-hfe [hidden] { display: none !important; }
.canvas-hfe .canvas-warn { margin: 0 0 24px; max-width: 62ch; font-size: 16px; font-weight: 700; }
.canvas-hfe h1 { font-weight: 700; font-size: clamp(30px, 3.3vw, 48px); line-height: 1.1; letter-spacing: -0.01em; margin: 28px 0 12px; padding-bottom: 0.18em; text-wrap: balance; }
.canvas-hfe .lead { font-size: 20px; line-height: 1.6; max-width: 62ch; margin: 0 0 24px; text-wrap: pretty; }
.canvas-hfe .field-label { display: block; font-weight: 700; margin: 0 0 8px; }
.canvas-hfe textarea { display: block; width: 100%; font: 500 18px/1.5 var(--mm-font-display); color: var(--ink); background: var(--card); border: 1.5px solid var(--ink); border-radius: var(--mm-radius-card); padding: 16px; resize: vertical; min-height: 150px; }
.canvas-hfe textarea:hover { border-width: 2px; padding: 15.5px; }
.canvas-hfe .msg { margin: 12px 0 0; padding: 8px 16px; border-left: 4px solid var(--ink); font-weight: 700; }
.canvas-hfe .msg::before { content: "\25B2\00a0"; }
.canvas-hfe .actions { display: flex; align-items: center; gap: 20px; margin-top: 16px; flex-wrap: wrap; }
.canvas-hfe .hint { font-size: 16px; }
.canvas-hfe .examples { margin-top: 24px; display: flex; align-items: center; gap: 12px 16px; flex-wrap: wrap; }
.canvas-hfe .ex-label { font-weight: 700; }
.canvas-hfe .privacy { font-size: 16px; margin: 16px 0 0; }
.canvas-hfe .export-off { display: flex; align-items: center; gap: 16px; margin: 20px 0 0; font-size: 16px; }
.canvas-hfe .export-off button { min-height: 48px; }
.canvas-hfe .export-off span { font-size: 16px; }
.canvas-hfe .results { margin-top: var(--gap); }
.canvas-hfe .summary-block { border-bottom: 1px solid var(--hair); padding-bottom: 20px; }
.canvas-hfe #summary { font-weight: 800; font-size: 34px; line-height: 1.15; letter-spacing: -0.03em; margin: 0 0 16px; scroll-margin-top: 8px; }
.canvas-hfe #summary:focus { outline: none; }
.canvas-hfe .export-row { display: flex; align-items: center; gap: 12px 24px; flex-wrap: wrap; }
.canvas-hfe .export-row.end { margin-top: 20px; }
.canvas-hfe .findings { list-style: none; margin: var(--card-gap) 0 0; padding: 0; display: grid; gap: var(--card-gap); }
.canvas-hfe .card { background: var(--card); border: 1px solid var(--hair); border-left: 5px solid var(--ink); border-radius: var(--mm-radius-card); }
.canvas-hfe .card.sev-safety-critical { border-left-width: 8px; }
.canvas-hfe .card.sev-minor { border-left-width: 3px; }
.canvas-hfe .card.sev-cosmetic { border-left: 1px dashed var(--ink); }
.canvas-hfe .card-head { border-radius: var(--mm-radius-card); display: block; width: 100%; text-align: left; background: none; border: 0; color: inherit; font: inherit; cursor: pointer; padding: 20px var(--pad) 12px; min-height: 56px; position: relative; }
.canvas-hfe .card-head:hover { background: var(--mm-teal-wash); }
.canvas-hfe .card-head h3 { font-weight: 800; font-size: 24px; line-height: 1.2; margin: 10px 40px 4px 0; letter-spacing: -0.01em; text-wrap: balance; }
.canvas-hfe .chev { position: absolute; right: var(--pad); top: 24px; width: 20px; height: 20px; transition: transform 150ms; fill: none; stroke: currentColor; stroke-width: 2.5; }
.canvas-hfe .card-head[aria-expanded="true"] .chev { transform: rotate(180deg); }
.canvas-hfe .sev-help { font-size: 16px; margin: 0; }
.canvas-hfe .sev { display: inline-flex; align-items: center; gap: 8px; font: 700 14px/1 var(--mm-font-label); text-transform: uppercase; letter-spacing: 0.14em; padding: 6px 10px; border-radius: 0; }
.canvas-hfe .sev svg { width: 16px; height: 16px; flex: none; fill: currentColor; stroke: currentColor; }
.canvas-hfe .sev-safety-critical .sev { border: 3px solid var(--ink); }
.canvas-hfe .sev-major .sev { border: 2px solid var(--ink); }
.canvas-hfe .sev-minor .sev { border: 1.5px solid var(--ink); }
.canvas-hfe .sev-cosmetic .sev { padding-left: 0; }
.canvas-hfe .badge { display: inline-block; margin: 0 var(--pad) 4px; border: 2px solid var(--ink); border-radius: 0; padding: 4px 12px; font: 700 14px/1.2 var(--mm-font-label); text-transform: uppercase; letter-spacing: 0.14em; }
.canvas-hfe .words { margin: 8px var(--pad) 0; }
.canvas-hfe .words-label, .canvas-hfe .lbl { font-weight: 700; }
.canvas-hfe .strip { margin-top: 6px; background: var(--strip); border: 1px solid var(--hair); border-radius: var(--mm-radius-card); padding: 16px 20px; font-weight: 600; font-size: 20px; line-height: 1.8; overflow-wrap: anywhere; white-space: pre-wrap; }
.canvas-hfe .card.closed .sclip { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
/* Lab v3: on a phone the evidence in a closed card shows in full (the 2-line clamp hid the marked phrase: 59 px at 390, 92 px at 360). */
@media (max-width: 767px) { .canvas-hfe .card.closed .sclip { display: block; overflow: visible; } }
.canvas-hfe .mark { padding: 0 2px; }
.canvas-hfe .mark-safety-critical { border: 3px solid var(--ink); border-radius: 0; padding: 0 0.2em; margin: 0 0.15em; white-space: nowrap; }
.canvas-hfe .mark-major { text-decoration: underline double; text-decoration-thickness: 2px; text-underline-offset: 5px; }
.canvas-hfe .mark-minor { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 5px; }
.canvas-hfe .mark-cosmetic { text-decoration: underline dotted; text-decoration-thickness: 2px; text-underline-offset: 5px; }
.canvas-hfe .chg { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 4px; }
.canvas-hfe .nb { white-space: nowrap; }
.canvas-hfe .draw .mark { animation: draw 450ms ease-out 1; }
@keyframes draw { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0 0 0 0); } }
.canvas-hfe .card-body { padding: 8px var(--pad) var(--pad); }
.canvas-hfe .card-body > p { margin: 16px 0 0; max-width: 62ch; }
.canvas-hfe .fixes { list-style: none; padding: 0; margin: 8px 0 0; display: grid; gap: 12px; }
.canvas-hfe .fix { border: 1px solid var(--hair); border-radius: var(--mm-radius-card); }
.canvas-hfe .fix.f1 { border: 1.5px solid var(--ink); }
.canvas-hfe .fix-head { border-radius: var(--mm-radius-card); display: flex; align-items: center; gap: 14px; width: 100%; background: none; border: 0; color: inherit; font: 700 18px/1.3 var(--mm-font-display); text-align: left; cursor: pointer; padding: 10px 16px; min-height: 56px; }
.canvas-hfe .fix.f1 .fix-head { font-size: 20px; }
.canvas-hfe .fix-head:hover { background: var(--mm-teal-wash); }
.canvas-hfe .rank { flex: none; width: 36px; height: 36px; border: 2px solid var(--ink); border-radius: var(--mm-radius-small); display: grid; place-items: center; font: 700 20px/1 var(--mm-font-label); }
.canvas-hfe .fix-body { padding: 4px 16px 16px; }
.canvas-hfe .pair { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.canvas-hfe .ba { border: 1px solid var(--hair); border-radius: var(--mm-radius-card); padding: 10px 14px; background: var(--strip); }
.canvas-hfe .ba.after { border-left: 3px solid var(--ink); }
.canvas-hfe .ba b { display: block; font-size: 16px; }
.canvas-hfe .ba div { line-height: 1.7; white-space: pre-wrap; overflow-wrap: anywhere; }
.canvas-hfe .gapu { white-space: nowrap; }
.canvas-hfe .sp { display: inline-block; white-space: pre; }
.canvas-hfe .gapmark { display: inline-block; margin: 0 0.15em; line-height: 1.15; border: 1.5px dashed var(--ink); border-radius: 0; padding: 0 0.2em; white-space: nowrap; text-decoration: none; }
.canvas-hfe .needs { margin: 12px 0 0; padding: 12px 16px; max-width: none; border: 2px dashed var(--ink); background: var(--strip); border-radius: var(--mm-radius-card); }
.canvas-hfe .tradeoff { margin: 10px 0 0; }
.canvas-hfe .also, .canvas-hfe .same { margin: 10px 0 0; }
.canvas-hfe .card-body > p.src { max-width: none; }
.canvas-hfe .src { font-size: 16px; border-top: 1px solid var(--hair); padding-top: 12px; margin-top: 20px; }
.canvas-hfe .tm-box { border: 1px solid var(--hair); padding: 16px; margin-top: 16px; border-radius: var(--mm-radius-card); }
.canvas-hfe .tm-box p { margin: 0 0 8px; }
.canvas-hfe .limit { border-top: 3px solid var(--ink); margin: var(--gap) 0 0; padding-top: 16px; max-width: 62ch; }
.canvas-hfe #src-body ul { padding-left: 20px; }
.canvas-hfe .phone-only { display: none; }
@media (max-width: 700px) {
  .canvas-hfe { font-size: 16px; }
  .canvas-hfe { --pad: 20px; --gap: 32px; --card-gap: 20px; }
  .canvas-hfe .desk { display: none; }
  .canvas-hfe .phone-only { display: inline; }
  .canvas-hfe .work { display: block; }
  .canvas-hfe .drop { min-height: 180px; padding: 20px; }
  .canvas-hfe h1 { margin: 20px 0 10px; }
  .canvas-hfe .lead { font-size: 16px; margin-bottom: 16px; }
  .canvas-hfe textarea { font-size: 16px; min-height: 112px; }
  .canvas-hfe .field-label { font-size: 16px; }
  .canvas-hfe .hint { display: none; }
  .canvas-hfe .export-off { flex-wrap: wrap; gap: 8px 16px; margin-top: 12px; }
  .canvas-hfe .actions { margin-top: 12px; }
  .canvas-hfe .examples { margin-top: 16px; }
  .canvas-hfe .ex-label { flex-basis: 100%; }
  .canvas-hfe #summary { font-size: 24px; }
  .canvas-hfe .card-head { padding-top: 16px; min-height: 64px; }
  .canvas-hfe .card-head h3 { font-size: 20px; }
  .canvas-hfe .chev { top: 20px; }
  .canvas-hfe .strip { font-size: 18px; padding: 12px 14px; }
  .canvas-hfe .pair { grid-template-columns: 1fr; gap: 10px; }
  .canvas-hfe .fix-head { font-size: 16px; }
  .canvas-hfe .fix.f1 .fix-head { font-size: 18px; }
}
@media print {
  .canvas-hfe { --bg: var(--lab-white); --on-ink: var(--lab-white); --card: var(--lab-white); --strip: var(--lab-white); --hair: var(--lab-hair); }
  .canvas-hfe .about, .canvas-hfe textarea, .canvas-hfe .field-label, .canvas-hfe .actions, .canvas-hfe .examples, .canvas-hfe .privacy, .canvas-hfe .export-row, .canvas-hfe .export-off, .canvas-hfe .lead, .canvas-hfe h1, .canvas-hfe .msg, .canvas-hfe .chev { display: none !important; }
  .canvas-hfe .card, .canvas-hfe .fix { break-inside: avoid; }
  .canvas-hfe .card-body, .canvas-hfe .fix-body { display: block !important; }
  .canvas-hfe { font-size: 12pt; }
}
.canvas-hfe .drop { background: var(--card); border: 1.5px solid var(--ink); border-radius: var(--mm-radius-card); box-shadow: 0 2px 0 var(--ink); min-height: 260px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; padding: 24px; text-align: center; margin: 0 0 16px; }
.canvas-hfe .drop.over { outline: solid 3px var(--mm-teal-bright); outline-offset: 0; }
.canvas-hfe .drop-hint { margin: 0; font-size: 16px; }
.canvas-hfe .switch { margin: 0 0 8px; }
.canvas-hfe .scope { font-size: 16px; margin: 12px 0 0; max-width: 68ch; }
.canvas-hfe .work { display: grid; grid-template-columns: 520px minmax(0, 1fr); gap: 32px; align-items: start; margin-top: 8px; }
.canvas-hfe .imgcol { position: sticky; top: 64px; }
.canvas-hfe .imgpanel { position: relative; border: 1px solid var(--hair); border-radius: var(--mm-radius-dialog); overflow: hidden; max-height: 80vh; background: var(--card); box-sizing: border-box; }
.canvas-hfe .imgpanel.gut { padding-left: 38px; }
.canvas-hfe #cvl { position: absolute; pointer-events: none; }
.canvas-hfe .leaders { position: absolute; left: 0; top: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
.canvas-hfe .imgpanel canvas { display: block; width: 100%; height: auto; max-height: 80vh; }
.canvas-hfe .imgnote { font-size: 14px; margin: 8px 0 0; }
.canvas-hfe .numbtn { position: absolute; width: 44px; height: 44px; padding: 0; border: 0; background: transparent; cursor: pointer; }
.canvas-hfe .numbtn span { position: absolute; left: 2px; top: 8px; width: 28px; height: 28px; display: grid; place-items: center; background: var(--ink); color: var(--bg); font: 700 16px/1 var(--mm-font-display); box-shadow: inset 0 1px 0 var(--bg); }
.canvas-hfe .numbtn.sel span { box-shadow: inset 0 0 0 3px var(--ring), 0 0 0 2px var(--bg); }   /* VR8 N2: ring 3 px inside the dark square (3:1 or more against the square and the ground), 2 px light gap outside */   /* the selected ring is drawn inside the square: it never grows toward the card edge or a box line */
.canvas-hfe .numsq { display: inline-grid; place-items: center; width: 28px; height: 28px; margin-right: 10px; background: var(--ink); color: var(--bg); font: 700 16px/1 var(--mm-font-display); vertical-align: middle; }
.canvas-hfe .card.picked { outline: solid 3px var(--mm-teal-bright); outline-offset: 2px; }
.canvas-hfe .onimg { margin: 8px var(--pad) 0; padding: 0; font-size: 16px; }
.canvas-hfe .status { margin: 0 0 12px; font-weight: 700; }
.canvas-hfe .bar { height: 4px; background: var(--hair); margin: 0 0 16px; }
.canvas-hfe .bar i { display: block; height: 4px; width: 0; background: var(--mm-teal); }
.canvas-hfe .step-h { font-weight: 800; font-size: 28px; line-height: 1.15; letter-spacing: -0.02em; margin: 0 0 8px; }
.canvas-hfe .step-h:focus { outline: none; }
.canvas-hfe .step-lead { margin: 0 0 16px; }
.canvas-hfe .low-line { margin: 12px 0 0; padding: 8px 16px; border-left: 1.5px dashed var(--ink); font-weight: 700; }
.canvas-hfe #mm { display: block; width: 160px; min-height: 48px; font: 500 18px/1.5 var(--mm-font-display); color: var(--ink); background: var(--card); border: 1.5px solid var(--ink); border-radius: var(--mm-radius-small); padding: 8px 12px; }
.canvas-hfe label[for="mm"] { margin-top: 20px; }
.canvas-hfe .help { font-size: 16px; margin: 8px 0 0; }
.canvas-hfe .notchecked { margin: 16px 0 20px; padding: 4px 0 4px 16px; border-left: 1.5px dashed var(--ink); }
.canvas-hfe .notchecked h3 { font-size: 20px; margin: 0 0 4px; }
.canvas-hfe .notchecked p, .canvas-hfe .notchecked ul { margin: 0 0 8px; }
.canvas-hfe .notchecked ul { padding-left: 20px; }
.canvas-hfe .note { margin: 0 0 12px; font-size: 16px; }
.canvas-hfe .fixes.plain { list-style: none; padding: 0; margin: 0 0 12px; }
.canvas-hfe .fixes.plain li { display: flex; gap: 12px; margin: 0 0 8px; }
.canvas-hfe .fixes.plain li.fix { padding: 8px 12px; align-items: center; }
/* hanging indent: a second title line starts under the words, not under the number square (38 px = square 28 + gap 10) */
.canvas-hfe .card-head h3 { padding-left: 38px; text-indent: -38px; }
.canvas-hfe .card-head h3 .numsq { text-indent: 0; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.canvas-hfe .card { animation: rise 150ms ease-out both; }
.canvas-hfe .work .results { margin-top: 0; }
@media (max-width: 1023px) {
  .canvas-hfe .work { display: block; }
  .canvas-hfe .imgcol { position: static; margin-bottom: 24px; }
  .canvas-hfe .imgpanel { max-height: 50vh; width: fit-content; max-width: 100%; margin: 0 auto; }
  .canvas-hfe .imgpanel canvas { max-height: 50vh; width: auto; max-width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  .canvas-hfe * { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}
.canvas-hfe .about { margin-top: var(--gap); padding-top: 20px; border-top: 1px solid var(--hair); font-size: 16px; line-height: 1.6; }
.canvas-hfe .about p, .canvas-hfe .about ul { max-width: 68ch; margin: 0 0 12px; }

/* step 2: example result. Before | after side by side from 900 px; alerts next to them from 1280 px; phone: stacked. */
.canvas-hfe .drop { min-height: 140px; }
.canvas-hfe .canvas-bar { display: flex; align-items: center; gap: 12px 20px; flex-wrap: wrap; margin: 0 0 20px; }
.canvas-hfe .canvas-name { flex: 1 1 260px; min-width: 0; }
.canvas-hfe .canvas-name h2 { margin: 0; font-weight: 800; font-size: 28px; line-height: 1.15; letter-spacing: -0.02em; }
.canvas-hfe .canvas-name h2:focus { outline: none; }
.canvas-hfe .canvas-name p { margin: 2px 0 0; font-size: 16px; }
.canvas-hfe .canvas-nav { display: flex; gap: 8px; }
.canvas-hfe .canvas-pair { display: grid; grid-template-columns: minmax(0, 1fr); gap: 24px; align-items: start; }
.canvas-hfe .canvas-panel { margin: 0; overflow: hidden; background: var(--lab-white); border: 1.5px solid var(--lab-ink); border-radius: 14px; box-shadow: 0 2px 0 var(--lab-ink); }
.canvas-hfe .canvas-panel img, .canvas-hfe .canvas-score img { display: block; width: 100%; height: auto; }
.canvas-hfe .canvas-alerts { padding: 20px 24px; background: var(--lab-white); border: 1.5px solid var(--lab-ink); border-radius: 14px; box-shadow: 0 2px 0 var(--lab-ink); font-size: 16px; line-height: 1.5; }
.canvas-hfe .canvas-block + .canvas-block { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--lab-hair); }
.canvas-hfe .canvas-h { display: flex; align-items: center; gap: 8px; margin: 0 0 6px; font: 700 15px/1.2 var(--lab-ui); text-transform: uppercase; letter-spacing: 0.14em; }
.canvas-hfe .canvas-h svg { width: 16px; height: 16px; flex: none; fill: currentColor; }
.canvas-hfe .canvas-fault { margin: 0 0 6px; font-weight: 700; font-size: 18px; line-height: 1.4; }
.canvas-hfe .canvas-ref { margin: 0 0 6px; font-size: 15px; color: var(--lab-ref); }
.canvas-hfe .canvas-moves { margin: 0 0 12px; padding-left: 24px; }
.canvas-hfe .canvas-moves li { margin: 0 0 6px; padding-left: 4px; }
.canvas-hfe .canvas-level { margin: 0 0 6px; font-weight: 700; }
.canvas-hfe .canvas-score { margin: 12px 0; }
.canvas-hfe .canvas-score summary { padding: 10px 0; cursor: pointer; font-weight: 700; text-decoration: underline; text-decoration-color: var(--lab-teal); text-decoration-thickness: 2px; text-underline-offset: 4px; }
.canvas-hfe .canvas-score img { margin-top: 8px; border: 1px solid var(--lab-hair); border-radius: 8px; }
.canvas-hfe .canvas-tag { margin: 12px 0 0; padding: 8px 12px; border: 1.5px dashed var(--lab-ink); border-radius: 8px; font-weight: 700; font-size: 15px; }
/* an open example: the start line goes, so the pictures sit higher; phone: buttons in one row, title under them */
.canvas-hfe:has(#result:not([hidden])) .lead { display: none; }
@media (max-width: 767px) {
  .canvas-hfe .canvas-bar { gap: 12px; }
  .canvas-hfe .canvas-bar .canvas-nav { margin-left: auto; }
  .canvas-hfe .canvas-bar button { padding: 0 14px; }
  .canvas-hfe .canvas-name { order: 3; flex-basis: 100%; }
  .canvas-hfe .canvas-name h2 { font-size: 24px; }
}
.canvas-hfe:has(#result:not([hidden])) h1 { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.canvas-hfe:has(#result:not([hidden])) { padding-top: 16px; }
@media (min-width: 900px) and (min-height: 600px) {
  .canvas-hfe:has(#result:not([hidden])) { padding-top: 24px; }
}
.canvas-hfe .canvas-panel:focus-visible, .canvas-hfe .canvas-alerts:focus-visible { outline: 3px solid var(--lab-teal); outline-offset: 2px; }
/* Fix round 3 (ruling 22 Nov, overrides the panel-scroll ruling): ONE page scroll only. A short fault + fix strip
   first, then BEFORE | AFTER side by side at their own height. No panel scrolls inside itself, so there is no cue. */
.canvas-hfe .canvas-bar { margin-bottom: 12px; }
.canvas-hfe .canvas-pair { gap: 16px 24px; }
.canvas-hfe .canvas-alerts { display: grid; grid-template-columns: minmax(0, 1fr); gap: 4px 20px; padding: 12px 20px; }
.canvas-hfe .canvas-alerts .canvas-h { margin: 0; line-height: 25px; }
.canvas-hfe .canvas-alerts .canvas-fault, .canvas-hfe .canvas-alerts .canvas-moves, .canvas-hfe .canvas-alerts .canvas-moves li { margin: 0; }
.canvas-hfe .canvas-alerts .canvas-h + * { margin-bottom: 6px; }
.canvas-hfe .canvas-extra { margin-top: 24px; padding: 16px 24px; background: var(--lab-white); border: 1.5px solid var(--lab-ink); border-radius: 14px; box-shadow: 0 2px 0 var(--lab-ink); font-size: 16px; line-height: 1.5; }
@media (min-width: 900px) {
  /* Fix round 4 (ruling 22 Nov): BEFORE and AFTER boxes have one height; gallery.js sets --cols from the picture ratios; 364 px = a 360 px picture and the box border. */
  .canvas-hfe .canvas-pair { --pmin: 364px; grid-template-columns: var(--cols, repeat(2, minmax(360px, 1fr))); align-items: stretch; }
  .canvas-hfe .canvas-alerts { grid-column: 1 / -1; grid-template-columns: max-content minmax(0, 1fr); gap: 6px 20px; align-items: baseline; }
  .canvas-hfe .canvas-alerts .canvas-h + * { margin-bottom: 0; }
}

/* Fix round 5b (plan 3b): BEFORE | AFTER side by side from 900 px, two equal columns, each picture 360-520 px wide, same top.
   The notes (rules, level, heuristics, score card) sit under BEFORE, the shorter column; gallery.js sets --wa so the columns end near one height.
   The top line joins the title row from 1200 px (gallery.js moves it), so the OK button of the BEFORE alert is in view. */
.canvas-hfe .canvas-pair > .canvas-extra { margin-top: 0; order: 5; }
.canvas-hfe .canvas-bar #disc-btn { flex: 1 1 260px; margin: 0; max-width: none; font-size: 16px; line-height: 1.3; }
@media (min-width: 900px) {
  .canvas-hfe .canvas-pair { --wb: 364px; --wa: var(--wb); grid-template-columns: var(--wb) var(--wa); justify-content: start; grid-template-rows: auto auto 1fr; align-items: start; }
  .canvas-hfe .canvas-pair > .canvas-panel:nth-of-type(1), .canvas-hfe .canvas-pair > .canvas-extra { grid-column: 1; width: min(var(--wb), 100%); order: 0; }
  .canvas-hfe .canvas-pair > .canvas-panel:nth-of-type(1) { grid-row: 2; }
  .canvas-hfe .canvas-pair > .canvas-extra { grid-row: 3; }
  .canvas-hfe .canvas-pair > .canvas-panel:nth-of-type(2) { grid-column: 2; grid-row: 2 / span 2; width: min(var(--wa), 100%); }
}
/* Lab v3.3 (ruling 23 Nov 5): BEFORE and AFTER are drawn at one width (364 px), so one type size. */
/* Lab v3.2 (HFE-S, 900 px and wider; Lab v3.4 ruling 5): fault strip first across the full header width; BEFORE + notes | AFTER in the middle;
   the spare width is 2 equal side margins. */
@media (min-width: 900px) {
  .canvas-hfe .canvas-pair { grid-template-columns: minmax(0, 1fr) var(--wb) var(--wa) minmax(0, 1fr); grid-template-rows: auto auto 1fr; }
  .canvas-hfe .canvas-pair > .canvas-alerts { grid-column: 1 / -1; grid-row: 1; grid-template-columns: max-content minmax(0, 1fr); }
  .canvas-hfe .canvas-pair > .canvas-panel:nth-of-type(1) { grid-column: 2; grid-row: 2; }
  .canvas-hfe .canvas-pair > .canvas-extra { grid-column: 2; grid-row: 3; }
  .canvas-hfe .canvas-pair > .canvas-panel:nth-of-type(2) { grid-column: 3; grid-row: 2 / span 2; }
}

/* no findings: no empty gap between the summary rule and the limit rule */
.canvas-hfe .findings:empty { display: none; }
.canvas-hfe .summary-block:has(~ .findings:empty) { border-bottom: 0; }
.canvas-hfe .findings:empty + .limit { margin-top: 24px; }
