/* PPTX Gate - "Checkpoint": the deck goes through a scanner. A neutral grey bed, the grey a slide editor puts
 * behind a slide, holds the slide and its thumbnails; a report sheet beside it reads out what was found. One file,
 * both themes, system fonts only.
 * House rule: no vertical stripes. Severity and state are shown by shape, tint and type - a round red count, a
 * square amber one, a hollow grey one - never by a coloured edge. Panes are parted by space and tone, not rules. */

:root {
  --bg: #1b1b1d;
  --panel: #27272a;
  --panel2: #333337;
  --ink: #f1f1f3;
  --ink-dim: #adadb5;
  --line: #404046;
  --well: #2b2b2b;
  --rail: #232323;
  --well2: #3d3d3d;
  --well-ink: #f0f0f0;
  --well-dim: #b4b4b4;
  --accent: #41d6c3;
  --accent-ink: #04221f;
  --accent-bg: #173f40;
  --hi: #ff6b4a;  --hi-on: #2a0700;  --hi-ink: #ffa590;  --hi-bg: #4a211a;
  --mid: #ffb83d; --mid-on: #2b1a00; --mid-ink: #ffc968; --mid-bg: #453410;
  --low: #8697ab; --low-on: #0b1118; --low-ink: #c2c6cf; --low-bg: #3a3a40;
  --ok: #3ddc97;  --ok-on: #03281a;  --ok-ink: #5fe3ab;  --ok-bg: #163f2d;
  /* on the slide itself, which is white in both themes */
  --mk-hi: #d1341b; --mk-mid: #f5a524; --mk-mid-line: #c77700; --mk-low: #64748b; --mk-ok: #12805c; --mk-pick: #0a6f7d;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.5), 0 8px 28px rgba(0, 0, 0, 0.45);
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --display: var(--sans);
  --r1: 6px; --r2: 10px; --r3: 14px;
  --i-open: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 8a2 2 0 0 1 2-2h4l2 2h8a2 2 0 0 1 2 2v7a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z'/%3E%3C/svg%3E");
  --i-sample: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 3l2.3 6.2L20.5 12l-6.2 2.3L12 21l-2.3-6.7L3.5 12l6.2-2.8z'/%3E%3C/svg%3E");
  --i-fix: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 3l7 3v5c0 4.6-2.9 8.3-7 10-4.1-1.7-7-5.4-7-10V6z'/%3E%3Cpath d='M8.8 12l2.3 2.3 4.2-4.6'/%3E%3C/svg%3E");
  --i-down: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 4v11M7 10.5l5 5 5-5M5 20h14'/%3E%3C/svg%3E");
  --i-page: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M7 3h7l5 5v13H7z'/%3E%3Cpath d='M14 3v5h5M10 13h6M10 17h6'/%3E%3C/svg%3E");
  --i-x: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round'%3E%3Cpath d='M6.5 6.5l11 11M17.5 6.5l-11 11'/%3E%3C/svg%3E");
  --i-check: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E");
  --i-warn: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 4l9 16H3z'/%3E%3Cpath d='M12 10v4.5M12 17.4v.2'/%3E%3C/svg%3E");
}

:root[data-theme="light"] {
  --bg: #f4f5f7;
  --panel: #ffffff;
  --panel2: #f0f1f4;
  --ink: #17191d;
  --ink-dim: #575c66;
  --line: #dfe1e6;
  --well: #e6e6e6;
  --rail: #eeeeee;
  --well2: #d4d4d4;
  --well-ink: #1f1f1f;
  --well-dim: #525252;
  --accent: #0a6f7d;
  --accent-ink: #ffffff;
  --accent-bg: #def2f3;
  --hi: #d1341b;  --hi-on: #ffffff;  --hi-ink: #a8260f;  --hi-bg: #fde8e3;
  --mid: #f5a524; --mid-on: #2b1a00; --mid-ink: #855000; --mid-bg: #fff0cf;
  --low: #64748b; --low-on: #ffffff; --low-ink: #4b5a6b; --low-bg: #e8edf2;
  --ok: #12805c;  --ok-on: #ffffff;  --ok-ink: #0c6b4c;  --ok-bg: #daf4e8;
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.08), 0 8px 28px rgba(16, 24, 40, 0.12);
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--sans); font-size: 15px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
code, pre, .mono { font-family: var(--mono); }
.small { font-size: 0.86em; }
.muted { color: var(--ink-dim); }
.hidden { display: none !important; }
a { color: var(--accent); }
button { font-family: inherit; font-size: 1em; cursor: pointer; color: inherit; }
button:disabled { cursor: not-allowed; opacity: 0.45; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.visually-hidden { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
h1, h2, h3, p { margin: 0; }

/* one way to draw an icon: a mask filled with the text colour */
#btnOpen::before, #btnSample::before, #fixAll::before, #btnDownload::before, #btnPdf::before, #clearAll::before,
.hz-title:not(.hz-has-n)::before, .verdict::before, .send-checks li::before, .toast::before, .op-item::before, .tabn-ok::before, .st-ok::before, .st-bad::before {
  content: ""; flex: 0 0 auto; display: inline-block; width: 16px; height: 16px; background: currentColor;
  -webkit-mask: var(--i, var(--i-check)) center / contain no-repeat; mask: var(--i, var(--i-check)) center / contain no-repeat;
}

/* --- command bar --------------------------------------------------------------------------- */
.cmd { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 8px 10px; flex-wrap: wrap; min-height: 56px; padding: 8px 14px; background: var(--bg); }
.cmd-brand { display: inline-flex; align-items: center; gap: 8px; font-weight: 750; letter-spacing: -0.01em; color: var(--ink); text-decoration: none; margin-right: 6px; white-space: nowrap; }
.logo { color: var(--accent); flex: 0 0 auto; }
.logo-arch { stroke: var(--accent-ink); }
.logo-dot { fill: var(--accent-ink); }
.cmd-group { display: flex; align-items: center; gap: 2px; }
.cmd-btn { display: inline-flex; align-items: center; gap: 6px; background: transparent; border: none; border-radius: 999px; padding: 7px 10px; font-weight: 600; white-space: nowrap; }
.cmd-btn:hover:not(:disabled):not(.cmd-primary) { background: var(--panel); }
#btnOpen { --i: var(--i-open); } #btnSample { --i: var(--i-sample); } #fixAll { --i: var(--i-fix); } #btnDownload { --i: var(--i-down); } #btnPdf { --i: var(--i-page); } #clearAll { --i: var(--i-x); }
.cmd-primary { background: var(--accent); color: var(--accent-ink); padding: 7px 16px 7px 12px; margin: 0 6px; box-shadow: 0 0 0 4px var(--accent-bg); }
.cmd-primary:hover:not(:disabled) { filter: brightness(1.08); }
.cmd-primary:disabled { box-shadow: none; }
.cmd-icon { margin-left: auto; padding: 7px; }
.seg { border-radius: 999px; padding: 3px; gap: 2px; background: var(--panel2); }
.seg-btn { display: inline-flex; align-items: center; gap: 6px; background: transparent; border: none; border-radius: 999px; padding: 4px 11px; font-weight: 600; color: var(--ink-dim); white-space: nowrap; }
.seg-btn[aria-selected="true"], .seg-btn[aria-pressed="true"] { background: var(--panel); color: var(--ink); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.18); }
.tabn { display: inline-flex; align-items: center; gap: 3px; min-width: 1.6em; justify-content: center; padding: 0 7px; border-radius: 999px; background: var(--hi); color: var(--hi-on); font-family: var(--mono); font-size: 0.78em; font-weight: 700; line-height: 1.6; }
.tabn:empty { display: none; }
.tabn-ok { background: var(--ok-bg); color: var(--ok-ink); }
.tabn-ok::before { width: 11px; height: 11px; }
.tabn-bad { background: var(--hi); color: var(--hi-on); }

/* --- empty state --------------------------------------------------------------------------- */
.empty { max-width: 880px; margin: 0 auto; padding: 18px 20px 50px; }
.hero h1 { font-size: 2.5rem; line-height: 1.08; letter-spacing: -0.03em; font-weight: 800; margin: 10px 0 10px; }
.lede { font-size: 1.05rem; max-width: 62ch; color: var(--ink-dim); }
.lede code { color: var(--ink); background: var(--panel2); padding: 1px 6px; border-radius: 5px; font-size: 0.92em; }
.card { background: var(--panel); border-radius: var(--r3); padding: 18px; margin: 16px 0; box-shadow: var(--shadow); }
.card h3 { font-size: 1.05rem; margin: 14px 0 8px; }
.card h3:first-child { margin-top: 0; }
.explain { box-shadow: none; background: transparent; padding: 8px 2px; }
.explain p { margin: 0 0 10px; max-width: 78ch; }
/* the drop zone is the bed itself: the same grey, waiting for a deck */
.dropzone { display: flex; position: relative; border-radius: var(--r2); background: var(--well); color: var(--well-ink); overflow: hidden; outline: 2px dashed var(--well-dim); outline-offset: -8px; }
.dz-big { flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 14px; padding: 34px 16px; min-height: 210px; transition: outline-color 0.15s; }
.dz-big > * { position: relative; }
.dropzone.over, body.dragging .dropzone { outline-color: var(--accent); }
.dz-big.busy { opacity: 0.7; }
.dz-title { font-size: 1.35rem; letter-spacing: -0.01em; }
.dz-actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.dz-note { color: var(--well-dim); font-family: var(--mono); font-size: 0.78em; }
.primary { background: var(--accent); color: var(--accent-ink); border: none; border-radius: 999px; padding: 11px 24px; font-weight: 650; }
.dz-pick { display: inline-block; cursor: pointer; }
.dz-pick:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }
.ghost { background: var(--panel); color: var(--ink); border: 1px solid var(--line); border-radius: 999px; padding: 10px 20px; font-weight: 650; }
.ghost:hover:not(:disabled) { border-color: var(--accent); }
.mini { background: var(--panel2); color: var(--ink); border: none; border-radius: 999px; padding: 5px 12px; font-size: 0.86em; font-weight: 550; }
.mini:hover:not(:disabled) { background: var(--accent-bg); }
.linkbtn { background: none; border: none; padding: 0; color: var(--accent); text-decoration: underline; font-size: 1em; }
.hz-intro { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; padding: 0; margin: 14px 0 12px; }
.hz-intro li { display: inline-flex; align-items: center; gap: 6px; font-size: 0.84em; color: var(--ink); background: var(--panel2); border-radius: 999px; padding: 3px 11px 3px 8px; }
.hz-intro li::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--hi); }
.hz-intro li:nth-child(3n+2)::before { background: var(--mid); border-radius: 2px; }
.hz-intro li:nth-child(3n)::before { background: transparent; box-shadow: inset 0 0 0 2px var(--low); }
#checkStatus:empty, #fileStatus:empty { display: none; }
#checkStatus { margin: 8px 0 0; overflow-wrap: anywhere; }
.warnline { color: var(--hi-ink); }
.foot { color: var(--ink-dim); font-size: 0.86em; text-align: center; padding: 10px 0; }

/* --- the workspace: scan bed (rail + canvas), report sheet, status line --------------------------- */
body.has-deck { overflow: hidden; display: flex; flex-direction: column; height: 100vh; height: 100dvh; }
body.has-deck .cmd { position: static; flex: 0 0 auto; }
.work { flex: 1 1 auto; min-height: 0; display: grid; grid-template-columns: 150px minmax(0, 1fr) 372px; grid-template-rows: minmax(0, 1fr) auto; grid-template-areas: "rail center insp" "status status status"; padding: 0 10px; }
.rail { grid-area: rail; overflow-y: auto; padding: 12px 10px; background: var(--rail); border-radius: var(--r3) 0 0 var(--r3); display: flex; flex-direction: column; gap: 10px; scrollbar-width: thin; scrollbar-color: var(--well2) transparent; }
.th { position: relative; display: grid; grid-template-columns: 14px minmax(0, 1fr); gap: 6px; align-items: start; background: transparent; border: none; padding: 4px; border-radius: 8px; text-align: left; }
.th:hover { background: var(--well2); }
.th-n { font-family: var(--mono); font-size: 0.72em; color: var(--well-dim); text-align: right; padding-top: 1px; }
.th-frame { display: block; width: 100%; background: #fff; border-radius: 3px; overflow: hidden; pointer-events: none; box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.14), 0 1px 3px rgba(0, 0, 0, 0.12); }
.th.is-current { background: var(--well2); }
.th.is-current .th-frame { outline: 2px solid var(--accent); outline-offset: 2px; }
.th.is-current .th-n { color: var(--well-ink); font-weight: 700; }
.th-hidden .th-frame { opacity: 0.45; }
.th-badge { position: absolute; top: -3px; right: -3px; min-width: 19px; height: 19px; padding: 0 5px; border-radius: 10px; background: var(--mk-hi); color: #fff; font-family: var(--mono); font-size: 0.72em; font-weight: 700; line-height: 19px; text-align: center; box-shadow: 0 0 0 2px var(--rail); }
.th-tag { position: absolute; left: 28px; bottom: 8px; font-family: var(--mono); font-size: 0.64em; letter-spacing: 0.04em; text-transform: uppercase; padding: 0 5px; border-radius: 3px; background: #0e141d; color: #e8eef5; }
.center { grid-area: center; display: flex; flex-direction: column; min-width: 0; min-height: 0; background: var(--well); color: var(--well-ink); border-radius: 0 var(--r3) var(--r3) 0; }
.cbar { display: flex; align-items: center; gap: 2px; padding: 8px 12px 4px; }
.cbar-label { font-family: var(--mono); font-size: 0.8em; white-space: nowrap; min-width: 8em; text-align: center; font-variant-numeric: tabular-nums; color: var(--well-dim); }
.cbar-zoom { min-width: 3.4em; }
.cbar-gap { flex: 1 1 auto; }
.cbtn { background: transparent; border: none; border-radius: 999px; min-width: 30px; height: 30px; padding: 0 8px; font-size: 1.1em; line-height: 1; color: var(--well-ink); }
.cbtn:hover:not(:disabled) { background: var(--well2); }
.cbtn-text { font-family: var(--mono); font-size: 0.76em; font-weight: 600; }
.cbtn[aria-pressed="true"] { background: var(--well2); color: var(--well-ink); }
.canvas { flex: 1 1 auto; min-height: 0; overflow: auto; display: flex; scrollbar-width: thin; scrollbar-color: var(--well2) transparent; }
.board { position: relative; flex: 0 0 auto; margin: auto; overflow: hidden; }
.stage { position: absolute; background: #fff; border-radius: 2px; box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.1), 0 2px 10px rgba(0, 0, 0, 0.18); overflow: hidden; }
.stage.is-loading::after { content: "Drawing the slide\2026"; position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: #6b7280; font-size: 0.9rem; }
.overlay { position: absolute; pointer-events: none; }
.overlay > * { pointer-events: auto; }
/* markers. A frame goes all the way round its object; its number says how serious by shape as well as colour:
 * round = sensitive, square = check, hollow = minor. Outlines only: what is on the slide stays readable. */
.mk { position: absolute; margin: 0; padding: 0; background: transparent; border: 2px solid var(--mk-hi); border-radius: 5px; }
.mk-b-medium { border-color: var(--mk-mid-line); }
.mk-b-low { border-color: var(--mk-low); }
.mk-off { border-style: dashed; background: repeating-linear-gradient(45deg, rgba(245, 165, 36, 0.16), rgba(245, 165, 36, 0.16) 2px, transparent 2px, transparent 9px); }
.mk-clipped { border-right-style: dotted; }
.mk-keep { background: transparent; border-color: var(--mk-ok); }
.mk-more { pointer-events: none; border-style: dotted; position: absolute; }
.mk-ghost { position: absolute; pointer-events: none; outline: 2px dashed var(--mk-hi); outline-offset: -1px; border-radius: 3px; overflow: hidden; }
.mk-ghost img { display: block; width: 100%; height: 100%; opacity: 0.28; }
.mk-ghost.is-selected { outline-width: 3px; }
.mk-ghost.is-selected img { opacity: 0.85; }
/* numbers sit above every outline, so each can be clicked even when two markers share an object */
.mk-num, .is-num { min-width: 22px; height: 22px; padding: 0 5px; border-radius: 11px; background: var(--mk-hi); color: #fff; font-family: var(--mono); font-size: 12px; font-weight: 700; line-height: 22px; text-align: center; }
.mk-num { z-index: 5; position: absolute; left: -12px; top: -12px; box-shadow: 0 0 0 2px #fff, 0 2px 6px rgba(0, 0, 0, 0.35); }
.mk-num.mk-medium, .is-num.mk-medium { background: var(--mk-mid); color: #2b1a00; border-radius: 6px; }
.mk-num.mk-low, .is-num.mk-low { background: #fff; color: #334155; box-shadow: inset 0 0 0 2px var(--mk-low); }
.mk-num.mk-low { box-shadow: inset 0 0 0 2px var(--mk-low), 0 0 0 2px #fff, 0 2px 6px rgba(0, 0, 0, 0.35); }
.mk-pin { width: 0; height: 0; border: none; }
.mk-pin .mk-num { left: -11px; top: -11px; border-radius: 11px 11px 11px 2px; }
.mk.is-selected { box-shadow: 0 0 0 3px var(--mk-pick), 0 0 0 6px rgba(255, 255, 255, 0.9), 0 0 0 7px rgba(10, 111, 125, 0.35); z-index: 3; }
.mk-pin.is-selected { box-shadow: none; }
.mk-pin.is-selected .mk-num, .mk-chip.is-selected .mk-num { box-shadow: 0 0 0 2px #fff, 0 0 0 5px var(--mk-pick); }
@keyframes mk-in { from { opacity: 0; transform: scale(0.6); } to { opacity: 1; transform: none; } }
.mk-num { animation: mk-in 0.22s ease-out both; }
.strip { display: flex; flex-wrap: wrap; gap: 6px; padding: 6px 12px 10px; justify-content: center; }
.mk-chip { position: static; display: inline-flex; align-items: center; gap: 7px; padding: 3px 12px 3px 3px; border: none; border-radius: 999px; background: var(--well2); color: var(--well-ink); font-size: 0.82em; }
.mk-chip .mk-num { position: static; box-shadow: none; animation: none; }
.mk-chip.is-selected { box-shadow: 0 0 0 2px var(--accent); }
.ws-note { padding: 4px 12px 8px; color: var(--well-dim); text-align: center; }

.insp { grid-area: insp; overflow-y: auto; padding: 16px 16px 20px; margin-left: 10px; background: var(--panel); border-radius: var(--r3); min-width: 0; scrollbar-width: thin; }
.insp-file { margin-bottom: 10px; overflow-wrap: anywhere; font-family: var(--mono); font-size: 0.74em; }
.insp-h { font-family: var(--mono); font-size: 0.72em; font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em; color: var(--ink-dim); margin: 16px 0 6px; padding-top: 12px; border-top: 1px solid var(--line); }
/* the headline: the count set large in its severity colour, the words beside it */
.hz-title { display: flex; align-items: center; flex-wrap: wrap; gap: 0 12px; font-size: 1.12rem; font-weight: 650; line-height: 1.2; letter-spacing: -0.01em; margin-bottom: 10px; }
.hz-pre { flex: 0 0 100%; font-family: var(--mono); font-size: 0.68em; font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em; color: var(--ink-dim); }
.hz-n { font-family: var(--display); font-size: 3.6rem; font-weight: 800; line-height: 0.95; letter-spacing: -0.06em; font-variant-numeric: tabular-nums; color: var(--ink); }
.hz-error .hz-n { color: var(--hi); } .hz-warn .hz-n { color: var(--mid-ink); } .hz-ok .hz-n { color: var(--ok-ink); }
.hz-has-n .hz-t { flex: 1 1 0; max-width: 8.5em; }
.hz-title:not(.hz-has-n) { gap: 4px 12px; flex-wrap: nowrap; }
.hz-title:not(.hz-has-n) .hz-pre { flex: 0 0 auto; }
.hz-title:not(.hz-has-n) .hz-t { flex: 1 1 0; }
/* no count to show: a coin with a tick (or a cross) cut out of it */
.hz-title:not(.hz-has-n)::before { width: 40px; height: 40px; color: var(--ok); -webkit-mask: var(--i, var(--i-check)) center / 24px no-repeat, radial-gradient(circle closest-side, #000 96%, transparent 100%); -webkit-mask-composite: xor; mask: var(--i, var(--i-check)) center / 24px no-repeat exclude, radial-gradient(circle closest-side, #000 96%, transparent 100%); }
.hz-title.hz-error:not(.hz-has-n)::before { --i: var(--i-x); color: var(--hi); }
/* the meter: one horizontal band, each severity as wide as its share */
.hz-chips { display: flex; gap: 3px; margin-bottom: 12px; border-radius: 999px; overflow: hidden; }
.hz-pill { display: inline-flex; align-items: center; gap: 5px; font-size: 0.74em; font-weight: 700; padding: 0 9px; border-radius: 999px; white-space: nowrap; line-height: 1.7; }
.hz-chips .hz-pill { flex: 1 1 auto; min-width: max-content; justify-content: center; border-radius: 3px; padding: 3px 9px; font-family: var(--mono); font-size: 0.72em; }
.hz-pill.hz-high { background: var(--hi); color: var(--hi-on); }
.hz-pill.hz-medium { background: var(--mid); color: var(--mid-on); }
.hz-pill.hz-low { background: var(--low-bg); color: var(--low-ink); }
/* in a row the severity is a quiet word; the count carries the colour and the shape */
.hz-card .hz-pill, .is-row .hz-pill { background: transparent; padding: 0; font-family: var(--mono); font-size: 0.66em; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; }
.hz-card .hz-pill.hz-high, .is-row .hz-pill.hz-high { color: var(--hi-ink); }
.hz-card .hz-pill.hz-medium, .is-row .hz-pill.hz-medium { color: var(--mid-ink); }
.hz-card .hz-pill.hz-low, .is-row .hz-pill.hz-low { color: var(--low-ink); }
.hz-cards { display: flex; flex-direction: column; }
.hz-card { display: grid; grid-template-columns: 20px minmax(0, 1fr) auto 34px; align-items: center; gap: 0 10px; padding: 3px 2px; border-top: 1px solid var(--line); }
.hz-card:first-child { border-top: none; }
.hz-card input, .send-check input, .fix-model-pick input { -webkit-appearance: none; appearance: none; width: 18px; height: 18px; margin: 0; border-radius: 6px; background: var(--panel2); box-shadow: inset 0 0 0 1.5px var(--ink-dim); cursor: pointer; flex: 0 0 auto; }
.hz-card input:checked, .send-check input:checked, .fix-model-pick input:checked { background-color: var(--accent); background-position: center; background-size: 13px; background-repeat: no-repeat; box-shadow: none; }
.hz-card input:checked, .send-check input:checked, .fix-model-pick input:checked { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E"); }
:root:not([data-theme="light"]) .hz-card input:checked, :root:not([data-theme="light"]) .send-check input:checked, :root:not([data-theme="light"]) .fix-model-pick input:checked { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2304221f' stroke-width='3.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E"); }
.hz-nofix { text-align: center; color: var(--ink-dim); }
.hz-name { background: none; border: none; padding: 3px 0; text-align: left; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hz-name:hover { color: var(--accent); }
.hz-count { justify-self: end; min-width: 26px; height: 22px; padding: 0 6px; border-radius: 11px; font-family: var(--mono); font-size: 0.82em; font-weight: 700; line-height: 22px; text-align: center; background: var(--low-bg); color: var(--low-ink); order: 4; }
.hz-b-high .hz-count { background: var(--hi-bg); color: var(--hi-ink); }
.hz-b-medium .hz-count { background: var(--mid-bg); color: var(--mid-ink); border-radius: 6px; }
.hz-btns { display: flex; gap: 6px; align-items: center; margin: 12px 0 6px; }
.hz-btns .ghost { padding: 6px 16px; margin-right: auto; }
.is-list { display: flex; flex-direction: column; gap: 2px; }
.is-row { display: grid; grid-template-columns: 24px minmax(0, 1fr) auto; gap: 0 10px; align-items: start; width: 100%; padding: 6px 8px; background: transparent; border: 1px solid transparent; border-radius: var(--r2); text-align: left; }
.is-row:hover { background: var(--panel2); }
.is-row.is-selected { background: var(--accent-bg); border-color: var(--accent); }
.is-row .hz-pill { padding-top: 3px; }
.is-text { font-size: 0.9em; overflow-wrap: anywhere; }
.is-note { color: var(--ink-dim); font-style: italic; }
.is-none { padding: 4px 8px; }
.exportrow { display: flex; gap: 6px; flex-wrap: wrap; margin: 12px 0 0; }
.fixbox { margin: 0 0 14px; }
.fix-model { border-radius: var(--r2); background: var(--accent-bg); padding: 10px 12px; margin-bottom: 8px; }
.fix-model-pick { display: flex; gap: 8px; align-items: flex-start; font-weight: 600; cursor: pointer; }
.fix-model-pick input { margin-top: 2px; }
.fix-model p { margin: 4px 0; }
/* the result of a fix: the count before, struck out, and the count now */
.hz-result { border-radius: var(--r2); padding: 14px; background: var(--panel2); }
.score { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; font-family: var(--display); font-variant-numeric: tabular-nums; line-height: 1; }
.score-from { font-size: 1.7rem; font-weight: 700; color: var(--ink-dim); text-decoration: line-through; text-decoration-thickness: 2px; text-decoration-color: var(--hi); }
.score-arrow { color: var(--ink-dim); flex: 0 0 auto; }
.score-to { font-size: 3.4rem; font-weight: 800; letter-spacing: -0.06em; color: var(--mid-ink); min-width: 1ch; }
.score-clear .score-to { color: var(--ok-ink); }
.score-word { font-family: var(--mono); font-size: 0.7rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em; color: var(--ink-dim); align-self: flex-end; padding-bottom: 7px; }
.hz-result .mini { background: var(--panel); }
.hz-result .mini:hover:not(:disabled) { background: var(--accent-bg); }
.score-clear { background: var(--ok-bg); margin: -14px -14px 12px; padding: 14px; border-radius: var(--r2) var(--r2) 0 0; }
@keyframes score-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.score { animation: score-in 0.35s ease-out both; }
.verdict { display: flex; gap: 8px; align-items: flex-start; font-weight: 650; margin-bottom: 8px; }
.verdict::before { margin-top: 3px; --i: var(--i-warn); color: var(--mid-ink); }
.verdict-ok::before { --i: var(--i-check); color: var(--ok-ink); }
.verdict-error::before { --i: var(--i-x); color: var(--hi-ink); }
.verdict:empty { display: none; }
.recon { list-style: none; margin: 0; padding: 0; font-size: 0.88em; }
.reconrow { display: grid; grid-template-columns: 5.6em minmax(0, 1fr); gap: 2px 8px; padding: 5px 0; border-top: 1px solid var(--line); overflow-wrap: anywhere; }
.reconrow > span:first-child { font-family: var(--mono); font-size: 0.78em; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; padding-top: 2px; }
.status-ok { color: var(--ok-ink); } .status-warn { color: var(--mid-ink); } .status-info { color: var(--ink-dim); }
.op-sub { margin: 6px 0 12px; }
.op-list { list-style: none; margin: 0 0 10px; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.op-item { display: grid; grid-template-columns: 18px minmax(0, 1fr); gap: 2px 10px; border-radius: var(--r2); background: var(--hi-bg); padding: 10px 12px; }
.op-item::before { --i: var(--i-x); color: var(--hi-ink); margin-top: 3px; grid-row: span 2; }
.op-item p { overflow-wrap: anywhere; grid-column: 2; }
.op-item .op-how { margin-top: 3px; }
.op-item .op-how.muted { color: var(--ink); opacity: 0.8; }
.status { grid-area: status; display: flex; gap: 6px 18px; flex-wrap: wrap; align-items: center; padding: 6px 6px; font-family: var(--mono); font-size: 0.72em; background: var(--bg); color: var(--ink-dim); min-height: 30px; }
.status span:empty { display: none; }
.st-right { margin-left: auto; }
.st-ok, .st-bad { display: inline-flex; align-items: center; gap: 5px; font-weight: 700; }
.st-ok { color: var(--ok-ink); } .st-bad { color: var(--hi-ink); }
.st-ok::before, .st-bad::before { width: 12px; height: 12px; }
.st-bad::before { --i: var(--i-x); }

.toasts { position: fixed; right: 16px; bottom: 44px; display: flex; flex-direction: column; gap: 8px; z-index: 50; max-width: min(420px, calc(100vw - 32px)); }
.toast { display: flex; gap: 10px; align-items: flex-start; background: var(--ink); color: var(--panel); border-radius: var(--r2); padding: 11px 16px 11px 12px; box-shadow: var(--shadow); transition: opacity 0.5s; }
.toast::before { margin-top: 3px; --i: var(--i-warn); }
.toast.ok::before { --i: var(--i-check); color: var(--ok); }
.toast.err::before { --i: var(--i-x); color: var(--hi); }
.toast.gone { opacity: 0; }
:root[data-theme="light"] .toast.ok::before { color: #3ddc97; } :root[data-theme="light"] .toast.err::before { color: #ff6b4a; }
:root:not([data-theme="light"]) .toast.ok::before { color: #12805c; } :root:not([data-theme="light"]) .toast.err::before { color: #d1341b; }

.lbl-short { display: none; }
body.view-send .fixbox { display: none; }
/* what Prepare to send adds: shown on the slide, never clickable */
.deco { position: absolute; display: flex; align-items: center; white-space: nowrap; pointer-events: none; font-family: Arial, Helvetica, sans-serif; line-height: 1; transform-origin: 50% 50%; z-index: 2; }
.deco-out { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; background: rgba(255, 255, 255, 0.78); color: #374151; font-weight: 700; pointer-events: none; z-index: 4; }
.th-out .th-frame { opacity: 0.3; }
.send h3 { font-family: var(--mono); font-size: 0.72em; font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em; color: var(--ink-dim); margin: 14px 0 8px; padding-top: 12px; border-top: 1px solid var(--line); }
.send h3:first-of-type { border-top: none; padding-top: 0; margin-top: 6px; }
.send-row { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 4px 8px; align-items: center; margin: 5px 0; font-size: 0.92em; }
.send-row > label:first-child { color: var(--ink-dim); }
.send-row input[type=text], .send-row select { width: 100%; min-width: 0; padding: 6px 10px; border: 1px solid transparent; border-radius: 8px; background: var(--panel2); color: var(--ink); font: inherit; }
.send-row input[type=text]:hover, .send-row select:hover { border-color: var(--line); }
.send-row input[type=text]::placeholder { color: var(--ink-dim); opacity: 0.8; }
.send-row input[type=range] { width: 100%; accent-color: var(--accent); }
.send-pair { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 6px; }
.send-check { display: flex; align-items: center; gap: 8px; margin: 6px 0; font-size: 0.92em; cursor: pointer; }
.send-go { display: flex; gap: 6px; margin: 14px 0 4px; }
.send-go .primary { flex: 1 1 0; padding: 9px 10px; }
.send-go .ghost { flex: 1 1 0; padding: 8px 10px; }
.send-checks { list-style: none; margin: 0; padding: 0; font-size: 0.88em; display: flex; flex-direction: column; gap: 6px; }
.send-checks li { display: flex; gap: 8px; align-items: flex-start; padding: 8px 10px; border-radius: var(--r2); background: var(--mid-bg); overflow-wrap: anywhere; }
.send-checks li::before { --i: var(--i-warn); color: var(--mid-ink); margin-top: 2px; }
.send-checks li.ok { background: var(--panel2); color: var(--ink-dim); }
.send-checks li.ok::before { --i: var(--i-check); color: var(--ok-ink); }

/* a laptop: the three views take their short names so the bar stays one row, Before and After included */
@media (max-width: 1500px) { .lbl-long { display: none; } .lbl-short { display: inline; } }
/* --- a phone: one column - canvas, slides as a strip, then the report ------------------------------ */
@media (max-width: 820px) {
  body.has-deck { overflow: auto; display: block; height: auto; }
  .cmd { gap: 6px 4px; padding: 6px 8px; min-height: 0; }
  body.has-deck .cmd { position: sticky; }
  .cmd-brand { display: none; }
  /* six commands do not fit 390 px: the sample is offered on the drop zone, the downloads only once a deck is open */
  body.has-deck #btnSample, body:not(.has-deck) #btnDownload, body:not(.has-deck) #btnPdf { display: none; }
  .cmd-group { flex-wrap: wrap; }
  #cmdFile { order: 0; } .cmd-icon { order: 1; } #cmdTabs { order: 2; } #cmdMode { order: 3; }
  .lbl-long { display: none; }
  .lbl-short { display: inline; }
  .send-row { grid-template-columns: 84px minmax(0, 1fr); }
  .cmd-btn { padding: 5px 7px; font-size: 0.93em; min-height: 34px; }
  #btnOpen::before, #btnDownload::before, #btnPdf::before, #clearAll::before { display: none; }
  .cmd-primary { padding: 5px 13px 5px 10px; margin: 0 3px; box-shadow: none; }
  .seg-btn { padding: 3px 9px; font-size: 0.9em; }
  .work { display: flex; flex-direction: column; height: auto; padding: 0; }
  .center { order: 1; border-radius: 0; }
  .canvas { flex: 0 0 auto; height: min(62vw, 300px); }
  .rail { order: 2; flex-direction: row; overflow-x: auto; overflow-y: hidden; border-radius: 0; padding: 4px 8px 8px; gap: 6px; }
  .th { flex: 0 0 62px; grid-template-columns: minmax(0, 1fr); gap: 0; padding: 3px; }
  .th-n, .th.is-current .th-n { position: absolute; left: 5px; top: 4px; z-index: 1; font-size: 0.62em; background: rgba(255, 255, 255, 0.85); color: #111; border-radius: 3px; padding: 0 3px; }
  .th-badge { top: -1px; right: -1px; min-width: 17px; height: 17px; line-height: 17px; }
  .th-tag { left: 5px; bottom: 5px; }
  .insp-file { display: none; }
  .insp { order: 3; margin: 0; border-radius: 0; overflow: visible; padding: 12px 12px 16px; }
  .status { order: 4; position: sticky; bottom: 0; padding: 4px 10px; gap: 0 10px; font-size: 0.66em; }
  #stSlide { display: none; }
  .st-right { display: none; }
  .cbar { padding: 4px 6px 2px; }
  .cbar-label { min-width: 7.6em; }
  .cbar-zoom { min-width: 3em; }
  .cbtn { min-width: 28px; padding: 0 6px; }
  .strip { padding: 4px 8px 6px; }
  .hz-title { margin-bottom: 8px; }
  .hz-n { font-size: 3.2rem; }
  .hz-has-n .hz-t { max-width: none; font-size: 1.2rem; }
  .hz-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
  .hz-card { grid-template-columns: 18px minmax(0, 1fr) auto; gap: 0 6px; padding: 2px 0; }
  .hz-count { min-width: 22px; padding: 0 4px; }
  .hz-card:nth-child(2) { border-top: none; }
  .hz-card .hz-pill { display: none; }
  .hz-name { font-size: 0.88em; letter-spacing: -0.01em; }
  .hero h1 { font-size: 1.9rem; margin-top: 4px; }
  .lede { font-size: 0.98rem; }
  .empty { padding: 8px 16px 40px; }
  .dz-big { padding: 22px 12px; min-height: 0; }
  .toasts { bottom: 38px; right: 8px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
@media print { .cmd, .rail, .cbar, .status, .toasts { display: none; } }
