/* Pattern Size Filter — styles. System fonts only; no external assets. */

:root {
  --paper: #eceef1;        /* cool page ground */
  --sheet: #ffffff;        /* working surfaces */
  --ink: #15171a;          /* text, primary buttons */
  --graphite: #565c66;     /* secondary text */
  --rule: #cfd3d9;         /* borders */
  --rule-soft: #e1e4e8;
  --yarn: #c8236a;         /* brand accent: magenta yarn */
  --yarn-soft: #f9e3ed;

  --rep-bg: #e3e6ea;       /* replaced value: cool grey + graphite underline */
  --rep-line: #15171a;
  --chk-bg: #fbe7b5;       /* group to check */
  --chk-line: #8a5300;
  --chk-bg2: #f3d488;
  --seg-a: #eef0f3;        /* size-specific section (hatched) */
  --seg-b: #dde1e7;
  --seg-line: #3d434c;

  --ok: #15171a;           /* success = graphite (shape + text carry the meaning) */
  --warn: #8a5300;
  --bad: #a1271f;
  --btn-hot: #a8175c;      /* primary hover: deep magenta, white text */
  --btn-press: #86104a;    /* primary pressed */
  --btn-soft: #e1e4e8;     /* quiet (text) button hover */
  --btn-dis-bg: #d5d8dd;   /* disabled */
  --btn-dis-line: #b9bec6;
  --btn-dis-ink: #6f7580;

  --display: "Bahnschrift", "DIN Alternate", "DIN Condensed", "Avenir Next Condensed", "Roboto Condensed", "Arial Narrow", system-ui, sans-serif;
  --text: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", "Segoe UI Mono", Menlo, Consolas, "Liberation Mono", monospace;

  --r-lg: 14px;
  --r-sm: 6px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #16181b;
    --sheet: #1f2226;
    --ink: #eceef1;
    --graphite: #a3a9b3;
    --rule: #3a3f46;
    --rule-soft: #2c3035;
    --yarn: #ff5e9c;
    --yarn-soft: #3a1d2a;
    --rep-bg: #353a41;
    --rep-line: #eceef1;
    --chk-bg: #4a3510;
    --chk-line: #f0b65a;
    --chk-bg2: #6a4a12;
    --seg-a: #23272c;
    --seg-b: #2e333a;
    --seg-line: #c4cad3;
    --ok: #eceef1;
    --warn: #f0b65a;
    --bad: #ff9a8f;
    --btn-hot: #c8236a;
    --btn-press: #a01a55;
    --btn-soft: #2c3035;
    --btn-dis-bg: #2c3035;
    --btn-dis-line: #474d55;
    --btn-dis-ink: #848a94;
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font: 16px/1.55 var(--text);
  overflow-wrap: break-word;
}
[hidden] { display: none !important; }
.wrap { width: 100%; max-width: 1320px; margin: 0 auto; padding: 0 28px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 12px; top: -60px; background: var(--ink); color: var(--sheet); padding: 8px 14px; border-radius: var(--r-sm); z-index: 10; }
.skip:focus { top: 12px; }
:focus-visible { outline: 3px solid var(--yarn); outline-offset: 2px; }

/* ---------- Masthead ---------- */
.masthead { border-bottom: 1px solid var(--rule); background: var(--sheet); }
.masthead-in { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 56px; }
.brand { display: flex; align-items: center; gap: 10px; }
.brand-mark { width: 22px; height: 22px; }
.brand-mark path { fill: var(--yarn); }
.brand-mark circle { fill: var(--sheet); }
.brand-name { font: 600 1.05rem/1 var(--display); letter-spacing: .01em; font-stretch: condensed; }
.masthead-note { margin: 0; color: var(--graphite); font-size: .88rem; }
.masthead-note::before { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--yarn); margin-right: 8px; vertical-align: 1px; }

/* ---------- Hero ---------- */
.hero {
  display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 56px; align-items: end;
  padding-top: 56px; padding-bottom: 44px;
}
h1 {
  font-family: var(--display); font-weight: 700; font-stretch: condensed;
  font-size: clamp(2.6rem, 6.4vw, 5.4rem); line-height: .92; letter-spacing: -.025em;
  margin: 0 0 22px; max-width: 9ch;
}
.lede { margin: 0; font-size: 1.12rem; line-height: 1.55; color: var(--graphite); max-width: 52ch; }

.specimen {
  margin: 0; background: var(--sheet); border: 1px solid var(--rule); border-radius: var(--r-lg);
  padding: 8px 0 0; position: relative; overflow: hidden;
}
/* gauge-ruler ticks along the top edge: the one material detail */
.specimen::before, .sheet-head::before {
  content: ""; position: absolute; left: 0; right: 0; top: 0; height: 8px;
  background:
    repeating-linear-gradient(90deg, var(--graphite) 0 1px, transparent 1px 10px),
    repeating-linear-gradient(90deg, var(--graphite) 0 1px, transparent 1px 50px);
  background-size: 100% 4px, 100% 8px; background-repeat: no-repeat; opacity: .45;
}
.spec-row { display: grid; grid-template-columns: 5.6rem minmax(0, 1fr); align-items: baseline; gap: 14px; padding: 14px 22px; border-bottom: 1px solid var(--rule-soft); }
.spec-tag { font: 600 .8rem/1.2 var(--text); color: var(--graphite); }
.spec-line { font: .98rem/1.6 var(--mono); white-space: pre-wrap; }
.specimen figcaption { padding: 14px 22px 18px; font-size: .9rem; color: var(--graphite); }

/* ---------- Tool ---------- */
.tool { padding-bottom: 56px; }
.bench { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 20px; align-items: start; }
.panel { background: var(--sheet); border: 1px solid var(--rule); border-radius: var(--r-lg); padding: 22px; }
.rail { display: grid; gap: 20px; position: sticky; top: 16px; }
.panel h2, .checks h2, .sheet-head h2 {
  font: 700 1.3rem/1.15 var(--display); font-stretch: condensed; letter-spacing: -.005em; margin: 0;
  display: flex; align-items: center; gap: 12px;
}
.step-no {
  flex: none; width: 30px; height: 30px; display: inline-grid; place-items: center;
  border: 2px solid var(--ink); border-radius: 50% 50% 50% 4px; /* stitch-marker silhouette */
  font: 700 .95rem/1 var(--display);
}
.panel-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 16px; }
.panel-foot { display: flex; align-items: center; gap: 10px 12px; margin-top: 14px; flex-wrap: wrap; }
#charInfo { margin-left: auto; font-variant-numeric: tabular-nums; }

textarea, input[type=text], select {
  font: inherit; color: var(--ink); background: var(--sheet);
  border: 1.5px solid var(--rule); border-radius: var(--r-sm);
}
textarea:focus, input[type=text]:focus, select:focus { border-color: var(--ink); outline: none; box-shadow: 0 0 0 3px var(--yarn-soft); }
#pattern {
  display: block; width: 100%; min-height: 420px; resize: vertical;
  padding: 16px 18px; font: 14.5px/1.6 var(--mono); tab-size: 4;
  background-image: linear-gradient(var(--rule-soft) 1px, transparent 1px);
  background-size: 100% calc(14.5px * 1.6); background-position: 0 calc(16px - 1px); background-attachment: local;
}
.field { margin-top: 16px; }
.field label { display: block; font-weight: 600; font-size: .92rem; margin-bottom: 6px; }
.field input { width: 100%; padding: 10px 12px; font: 15px/1.4 var(--mono); min-height: 44px; }
#struct { max-width: 12rem; }

.hint { margin: 0; color: var(--graphite); font-size: .95rem; }
.hint.small { font-size: .85rem; margin-top: 6px; }
#detectInfo { margin-top: 12px; }
.notice { margin: 12px 0 0; padding: 10px 12px; border-radius: var(--r-sm); border-left: 4px solid currentColor; font-size: .92rem; background: var(--paper); }
.notice:empty { display: none; }
.notice.warn { color: var(--warn); }
.notice.bad { color: var(--bad); font-weight: 600; }
.notice::before { font-weight: 700; margin-right: 6px; }
.notice.warn::before { content: "Check:"; }
.notice.bad::before { content: "Fix:"; }

.reads { margin: 18px 0 16px; padding: 12px 14px; border: 1.5px dashed var(--rule); border-radius: var(--r-sm); }
.reads-label { display: block; font-size: .8rem; font-weight: 600; color: var(--graphite); margin-bottom: 4px; }
.reads-line { display: block; font: 600 15px/1.5 var(--mono); white-space: pre-wrap; overflow-wrap: anywhere; min-height: 1.5em; }

.idle .hint { margin: 14px 0 18px; }
.idle-next { opacity: .45; padding-top: 16px; border-top: 1px solid var(--rule-soft); }

.pick-row { display: flex; gap: 10px; margin-top: 16px; }
#size { flex: 1; min-width: 0; min-height: 48px; padding: 0 12px; font: 600 1.05rem/1 var(--mono); }

/* Buttons. Hover only where a pointer can hover; press feedback (:active) for mouse and touch. */
.btn {
  font: 600 .98rem/1 var(--text); min-height: 44px; padding: 0 20px; border-radius: 999px;
  border: 1.5px solid var(--ink); cursor: pointer; white-space: nowrap;
  -webkit-tap-highlight-color: transparent; touch-action: manipulation;
  transition: background-color .12s, color .12s, border-color .12s, transform .08s, box-shadow .08s;
}
.btn.primary { background: var(--ink); color: var(--sheet); }
.btn.ghost { background: transparent; color: var(--ink); }
.btn.quiet { background: transparent; color: var(--graphite); border-color: transparent; text-decoration: underline; text-underline-offset: 4px; text-decoration-thickness: 1px; padding: 0 14px; }
.btn.quiet.small { padding: 0 12px; }
@media (hover: hover) {
  .btn.primary:hover:not(:disabled) { background: var(--btn-hot); border-color: var(--btn-hot); color: #fff; }
  .btn.ghost:hover:not(:disabled) { background: var(--ink); color: var(--sheet); }
  .btn.quiet:hover:not(:disabled) { background: var(--btn-soft); color: var(--ink); }
}
/* press: a 1px sink, slight shrink and an inner shadow; colours step one shade deeper */
.btn:active:not(:disabled) { transform: translateY(1px) scale(.98); box-shadow: inset 0 2px 0 rgba(0, 0, 0, .25); transition-duration: 0s; }
.btn.primary:active:not(:disabled) { background: var(--btn-press); border-color: var(--btn-press); color: #fff; }
.btn.ghost:active:not(:disabled) { background: var(--ink); border-color: var(--ink); color: var(--sheet); }
.btn.quiet:active:not(:disabled) { background: var(--rule); color: var(--ink); }
/* disabled: flat grey fill / dashed outline / dotted underline, no hover or press */
.btn:disabled { cursor: not-allowed; transform: none; box-shadow: none; }
.btn.primary:disabled { background: var(--btn-dis-bg); border-color: var(--btn-dis-bg); color: var(--btn-dis-ink); }
.btn.ghost:disabled { background: transparent; border-color: var(--btn-dis-line); border-style: dashed; color: var(--btn-dis-ink); }
.btn.quiet:disabled { color: var(--btn-dis-ink); text-decoration-style: dotted; }
.btn:focus-visible { outline: 3px solid var(--yarn); outline-offset: 3px; }
.undo-bar { display: flex; align-items: center; gap: 6px; margin: 12px 0 0; padding: 4px 4px 4px 12px; border: 1.5px dashed var(--rule); border-radius: var(--r-sm); font-size: .92rem; color: var(--graphite); }
.undo-bar span { flex: 1; }
.undo-bar .btn { color: var(--ink); font-weight: 700; }
.btn.block { width: 100%; min-height: 48px; }
#run { min-height: 48px; }

/* ---------- Result ---------- */
.result { margin-top: 28px; }
.result-bar { display: flex; align-items: stretch; gap: 14px; flex-wrap: wrap; }
.status {
  flex: 1 1 420px; display: block; align-self: stretch; min-height: 52px;
  padding: 14px 18px 14px 52px; border-radius: var(--r-lg); background: var(--sheet);
  border: 2px solid currentColor; position: relative; font-size: .98rem;
}
.status::before { /* shape + glyph so status never relies on colour alone */
  position: absolute; left: 16px; top: 50%; transform: translateY(-50%);
  width: 24px; height: 24px; display: grid; place-items: center; border-radius: 50%;
  font: 700 14px/1 var(--text); color: var(--sheet);
}
.status.ok { color: var(--ok); } .status.ok::before { content: "✓"; background: var(--ok); }
.status.warn { color: var(--warn); } .status.warn::before { content: "!"; border-radius: 4px; background: var(--warn); }
.status.bad { color: var(--bad); } .status.bad::before { content: "×"; border-radius: 4px; background: var(--bad); }
.status-main { font-weight: 700; }
.status-counts { color: var(--ink); }
.actions { display: flex; align-items: center; gap: 10px; }
.copied { font-weight: 600; color: var(--ok); min-width: 4.5em; opacity: 0; transition: opacity .2s; }
.copied.on { opacity: 1; }

.result-grid { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 20px; margin-top: 18px; align-items: start; }
.sheet { background: var(--sheet); border: 1px solid var(--rule); border-radius: var(--r-lg); overflow: hidden; }
.sheet-head { position: relative; padding: 22px 26px 14px; border-bottom: 1px solid var(--rule-soft); display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 20px; }
.legend { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: .85rem; color: var(--graphite); }
.legend li { display: flex; align-items: center; gap: 6px; }
.legend .rep, .legend .flag { font: 12.5px/1.6 var(--mono); }

.output {
  white-space: pre-wrap; overflow-wrap: anywhere;
  font: 15px/1.85 var(--mono); padding: 22px 26px 30px; max-width: 100%;
}
.result.no-output .sheet { display: none; }
.result.no-output .result-grid { grid-template-columns: 1fr; }

/* Marks */
mark.rep {
  background: var(--rep-bg); color: inherit; font-weight: 700;
  border-bottom: 2px solid var(--rep-line); border-radius: 3px 3px 0 0; padding: 0 2px;
  -webkit-box-decoration-break: clone; box-decoration-break: clone;
}
mark.rep.na { font-weight: 500; font-style: italic; border-bottom-style: dotted; }

/* Flags. A flag drawn in one piece gets a full box; a flag that overlaps others is split into
   fragments and drawn with underline + numbered start badge + end tick, which nest cleanly. */
.flag { -webkit-box-decoration-break: clone; box-decoration-break: clone; text-underline-offset: 5px; text-decoration-skip-ink: none; }
.flag.group { background: var(--chk-bg); text-decoration: underline dashed var(--chk-line) 1.5px; }
.flag .flag.group { background: var(--chk-bg2); }
.flag.segment {
  background: repeating-linear-gradient(135deg, var(--seg-a) 0 5px, var(--seg-b) 5px 7px);
  text-decoration: underline dotted var(--seg-line) 2px;
}
.flag.f-start.f-end { text-decoration: none; border: 1.5px dashed var(--chk-line); border-left: 3px solid var(--chk-line); border-radius: 4px; padding: 1px 3px 1px 2px; }
.flag.segment.f-start.f-end { border-color: var(--seg-line); border-style: dotted; border-left: 3px solid var(--seg-line); }
.flag.f-end:not(.f-start)::after {
  content: ""; display: inline-block; width: 0; height: 1.15em; vertical-align: -.22em; margin-left: 1px;
  border-left: 3px solid var(--chk-line);
}
.flag.segment.f-end:not(.f-start)::after { border-left-color: var(--seg-line); }

/* numbered stitch-marker badge — generated content, so it never enters innerText */
.flag.f-start::before {
  content: "#" attr(data-n);
  display: inline-block; vertical-align: 2px; margin-right: 5px;
  font: 700 11px/1 var(--text); letter-spacing: .01em;
  padding: 3px 6px 3px 5px; border-radius: 9px 9px 9px 2px;
  background: var(--ink); color: var(--sheet);
  font-style: normal;
}
.flag.segment.f-start::before { background: var(--sheet); color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--ink); }
.flag.demo { font-family: var(--mono); }
.flag.f-start:focus { outline: none; }
.flag.pulse { animation: pulse 1.2s ease-out; outline: 3px solid var(--yarn); outline-offset: 2px; }
@keyframes pulse { 0% { outline-offset: 7px; } 30% { outline-offset: 2px; } }

/* Checklist */
.checks { position: sticky; top: 16px; background: var(--sheet); border: 1px solid var(--rule); border-radius: var(--r-lg); padding: 22px 0 8px; max-height: calc(100vh - 32px); display: flex; flex-direction: column; }
.checks h2 { padding: 0 22px; }
.checks .hint { padding: 0 22px; margin-top: 6px; }
#flags { list-style: none; margin: 14px 0 0; padding: 0; overflow: auto; }
.check { border-top: 1px solid var(--rule-soft); }
.check-btn {
  all: unset; box-sizing: border-box; display: grid; gap: 4px; width: 100%; padding: 14px 22px; cursor: pointer;
}
.check-btn:hover { background: var(--paper); }
.check-btn:focus-visible { outline: 3px solid var(--yarn); outline-offset: -3px; }
.check-top { display: flex; align-items: center; gap: 10px; }
.check-n { font: 700 12px/1 var(--text); padding: 4px 8px 4px 7px; border-radius: 10px 10px 10px 2px; background: var(--ink); color: var(--sheet); }
.check.segment .check-n { background: var(--sheet); color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--ink); }
.check-line { font-size: .82rem; color: var(--graphite); font-variant-numeric: tabular-nums; }
.check-reason { font-weight: 600; font-size: .93rem; line-height: 1.35; }
.check-snip { font: 12.5px/1.5 var(--mono); color: var(--graphite); overflow-wrap: anywhere; white-space: pre-wrap; }

/* ---------- Info ---------- */
.info { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 40px; padding-top: 44px; padding-bottom: 56px; border-top: 1px solid var(--rule); }
.info h2 { font: 700 1.2rem/1.2 var(--display); font-stretch: condensed; margin: 0 0 12px; }
.info ul { margin: 0; padding-left: 1.1em; color: var(--graphite); }
.info li { margin: 6px 0; }
.info li::marker { color: var(--yarn); }
.info p { margin: 0; color: var(--graphite); }
.foot { border-top: 1px solid var(--rule); background: var(--sheet); }
.foot-in { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0 24px; }
.foot p { margin: 0; padding: 20px 0; font-size: .88rem; color: var(--graphite); }
.foot .contact { white-space: nowrap; }
.foot a { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--yarn); }
.foot a:hover { color: var(--yarn); }
@media (max-width: 640px) { .foot p + p { padding-top: 0; } }

/* Copy fallback dialog */
dialog { border: 1px solid var(--rule); border-radius: var(--r-lg); background: var(--sheet); color: var(--ink); padding: 24px; width: min(680px, calc(100vw - 32px)); }
dialog::backdrop { background: rgba(20, 22, 26, .45); }
dialog h2 { font: 700 1.3rem/1.2 var(--display); margin: 0 0 8px; }
#copyFallback { width: 100%; min-height: 260px; margin: 14px 0; padding: 12px; font: 13px/1.5 var(--mono); }

.print-head, .checks .print-only { display: none; }

/* ---------- Responsive ---------- */
@media (max-width: 1080px) {
  .bench, .result-grid { grid-template-columns: minmax(0, 1fr); }
  .rail, .checks { position: static; max-height: none; }
  #flags { max-height: 60vh; }
  .hero { grid-template-columns: minmax(0, 1fr); gap: 32px; }
}
@media (max-width: 640px) {
  .wrap { padding: 0 16px; }
  .masthead { display: none; } /* the H1 carries the name on phones */
  /* compact first screen: title + demo stay short so the paste box shows early */
  .hero { padding-top: 18px; padding-bottom: 16px; gap: 14px; }
  h1 { font-size: clamp(1.75rem, 8.4vw, 2.1rem); line-height: 1; letter-spacing: -.02em; max-width: none; margin-bottom: 8px; }
  .lede { font-size: .92rem; line-height: 1.45; }
  .specimen { padding-top: 6px; border-radius: 10px; }
  .specimen::before { height: 6px; background-size: 100% 3px, 100% 6px; }
  .spec-row { grid-template-columns: 3.6rem minmax(0, 1fr); gap: 8px; padding: 7px 12px; }
  .spec-row:last-of-type { border-bottom: 0; }
  .spec-tag { font-size: .72rem; }
  .spec-line { font-size: 12px; line-height: 1.5; }
  .spec-line .flag.f-start::before { font-size: 10px; padding: 2px 5px 2px 4px; margin-right: 3px; }
  .specimen figcaption { display: none; }
  .tool { padding-bottom: 40px; }
  .panel { padding: 16px 14px; }
  .panel-head { margin-bottom: 10px; }
  .panel-foot .btn { flex: 1 1 calc(50% - 6px); padding: 0 12px; }
  .panel-foot .btn.quiet { flex: none; order: 3; margin-left: -12px; }
  #charInfo { order: 4; margin-left: auto; }
  .panel h2, .checks h2, .sheet-head h2 { font-size: 1.15rem; gap: 10px; }
  .step-no { width: 26px; height: 26px; font-size: .85rem; }
  #pattern { min-height: 260px; font-size: 14px; padding: 12px; background-size: 100% calc(14px * 1.6); background-position: 0 calc(12px - 1px); }
  .output { font-size: 14px; line-height: 1.8; padding: 16px; }
  .sheet-head { padding: 18px 16px 12px; }
  .status { flex-basis: 100%; }
  .actions { width: 100%; }
  .actions .btn { flex: 1; }
  .info { grid-template-columns: minmax(0, 1fr); gap: 28px; }
  .pick-row { flex-direction: column; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* ---------- Print (spec §4.2) ---------- */
@media print {
  @page { margin: 16mm 14mm; }
  :root {
    --sheet: #fff; --paper: #fff; --ink: #000; --graphite: #333; --rule: #000;
    --rep-bg: transparent; --chk-bg: transparent; --seg-a: transparent; --seg-b: transparent;
    --rep-line: #000; --chk-line: #000; --seg-line: #000;
  }
  body { background: #fff; color: #000; font-size: 11pt; }
  .masthead, .hero, .bench, .info, .foot, .skip, .result-bar, .legend, .checks .hint, dialog, #outHead { display: none !important; }
  .wrap { padding: 0; max-width: none; }
  .tool { padding: 0; }
  .result { margin: 0; }
  .print-head { display: block; margin: 0 0 10pt; padding-bottom: 6pt; border-bottom: 1pt solid #000; }
  .print-head p { margin: 0; font: 11pt/1.4 var(--text); }
  .print-head p:first-child { font-weight: 700; }
  .result-grid { display: block; margin: 0; }
  .sheet, .checks { border: 0; border-radius: 0; overflow: visible; position: static; max-height: none; padding: 0; background: none; }
  .sheet-head { display: none; }
  .output { font: 11pt/1.7 var(--mono); padding: 0; white-space: pre-wrap; overflow-wrap: anywhere; color: #000; }
  mark.rep { background: none; border-bottom: 1pt solid #000; font-weight: 700; color: #000; }
  .flag, .flag.group, .flag.segment, .flag .flag.group { background: none !important; text-decoration: underline solid #000 1pt; }
  .flag.f-start.f-end, .flag.segment.f-start.f-end { text-decoration: none; border: 1pt solid #000 !important; border-left: 2pt solid #000 !important; }
  .flag.f-end:not(.f-start)::after { border-left: 2.5pt solid #000 !important; }
  .flag.f-start::before, .flag.segment.f-start::before {
    background: #fff !important; color: #000 !important; box-shadow: none !important;
    border: 1pt solid #000; font-size: 9pt; padding: 1pt 3pt;
    -webkit-print-color-adjust: exact; print-color-adjust: exact;
  }
  .checks { margin-top: 14pt; break-inside: auto; }
  .checks h2#flagHead { display: none; }
  .checks p.print-only { display: block; margin: 14pt 0 0; padding-top: 6pt; border-top: 1pt solid #000; font: 11pt/1.4 var(--text); color: #000; }
  .checks h2.print-only { display: block; font: 700 12pt/1.3 var(--text); padding: 0 0 4pt; border-bottom: 1pt solid #000; }
  #flags { overflow: visible; max-height: none; margin-top: 4pt; }
  .check { border-top: 0.5pt solid #999; break-inside: avoid; }
  .check-btn { display: block; padding: 4pt 0; }
  .check-top, .check-reason, .check-snip { display: inline; }
  .check-n { background: #fff; color: #000; border: 1pt solid #000; box-shadow: none; font-size: 10pt; margin-right: 5pt; }
  .check-line::after, .check-reason::after { content: " · "; }
  .check-line, .check-reason { font-size: 10.5pt; color: #000; }
  .check-snip { font-size: 10pt; color: #000; }
}
