/* BPT – vyhodnocení. Všechna pravidla jsou omezena na .bpt, aby nekolidovala s tématem WordPressu.
   Rozvržení: vlevo panel zadávání (jako záznamový arch), vpravo výsledky se záložkami. */
.bpt {
  /* barvy záznamového archu BPT: modrá #0b6fb8, světle modrá #eaf4fb */
  --bg: #ffffff;
  --surface: #ffffff;
  --surface-2: #f5f9fc;
  --ink: #17283a;
  --ink-2: #3d5064;
  --muted: #5a6b7b;
  --line: #d6e2ec;
  --line-strong: #a9bfd2;
  --accent: #0b6fb8;
  --accent-ink: #ffffff;
  --accent-soft: #eaf4fb;
  --age: #0b6fb8;
  --grade: #d9731a;
  --band: #eaf4fb;
  --ok: #23774a; --ok-bg: #e5f3ea;
  --mild: #8a5a00; --mild-bg: #fff3d6;
  --mod: #b3400d; --mod-bg: #fbe7dc;
  --high: #a61b1b; --high-bg: #fbeeee;
  --info-bg: #eaf4fb;
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", Menlo, Consolas, monospace;
  --r: 10px;
  color-scheme: light;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.45;
  color: var(--ink);
  background: var(--bg);
  border-radius: 0;
  padding: 0;
  box-sizing: border-box;
  text-align: left;
  container-type: inline-size;
  container-name: bpt;
}
.bpt[data-theme="dark"] {
  --bg: #11161d; --surface: #19202a; --surface-2: #1e2631; --ink: #e9eef5; --ink-2: #b8c2d0; --muted: #8e99a8;
  --line: #2b3542; --line-strong: #3b4757; --accent: #7fb2e5; --accent-ink: #0d1520; --accent-soft: #223246;
  --age: #3987e5; --grade: #e06a35; --band: #212c3a;
  --ok: #6fcf97; --ok-bg: #173323; --mild: #e8b85a; --mild-bg: #382c12; --mod: #f0925f; --mod-bg: #3a2216;
  --high: #f08080; --high-bg: #3d1a1a; --info-bg: #1b2a3d; color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  .bpt[data-theme="auto"] {
    --bg: #11161d; --surface: #19202a; --surface-2: #1e2631; --ink: #e9eef5; --ink-2: #b8c2d0; --muted: #8e99a8;
    --line: #2b3542; --line-strong: #3b4757; --accent: #7fb2e5; --accent-ink: #0d1520; --accent-soft: #223246;
    --age: #3987e5; --grade: #e06a35; --band: #212c3a;
    --ok: #6fcf97; --ok-bg: #173323; --mild: #e8b85a; --mild-bg: #382c12; --mod: #f0925f; --mod-bg: #3a2216;
    --high: #f08080; --high-bg: #3d1a1a; --info-bg: #1b2a3d; color-scheme: dark;
  }
}
.bpt *, .bpt *::before, .bpt *::after { box-sizing: border-box; }
.bpt h1, .bpt h2, .bpt h3, .bpt h4, .bpt p { margin: 0; padding: 0; color: inherit; font-family: var(--font); letter-spacing: 0; text-transform: none; }
.bpt button, .bpt input, .bpt select, .bpt textarea { font-family: var(--font); font-size: 14px; color: var(--ink); margin: 0; }
.bpt table { border-collapse: collapse; width: 100%; margin: 0; border: 0; font-variant-numeric: tabular-nums; }
.bpt th, .bpt td { border: 0; padding: 6px 8px; text-align: left; vertical-align: middle; background: none; font-size: 13.5px; }
.bpt :focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* záhlaví */
.bpt-top { display: flex; flex-wrap: wrap; gap: 12px 16px; align-items: center; justify-content: space-between; padding: 4px 4px 14px; }
.bpt-brand { display: flex; align-items: baseline; gap: 10px; }
.bpt-brand b { font-size: 20px; font-weight: 750; letter-spacing: .02em; }
.bpt-brand span { color: var(--muted); font-size: 14px; }
.bpt-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.bpt-btn { appearance: none; border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink); border-radius: 8px; padding: 7px 12px; cursor: pointer; font-weight: 550; line-height: 1.2; }
.bpt-btn:hover { border-color: var(--accent); }
.bpt-btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.bpt-btn.ghost { background: transparent; }
.bpt-btn[disabled] { opacity: .5; cursor: not-allowed; }

.bpt-grid { display: grid; grid-template-columns: minmax(0, 360px) minmax(0, 1fr); gap: 16px; align-items: start; }
@container bpt (max-width: 900px) { .bpt-grid { grid-template-columns: minmax(0, 1fr); } }

.bpt-panel { background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--r); padding: 14px; min-width: 0; }
.bpt-panel + .bpt-panel { margin-top: 12px; }
.bpt-h { font-size: 13px; font-weight: 700; color: var(--accent-ink); background: var(--accent); margin: -14px -14px 12px; padding: 8px 14px; border-radius: var(--r) var(--r) 0 0; display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.bpt-h small { font-weight: 500; opacity: .9; }

/* formulář */
.bpt-f { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.bpt-f .full { grid-column: 1 / -1; }
.bpt-field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.bpt-field > span { font-size: 12.5px; color: var(--ink-2); font-weight: 550; }
.bpt input[type="text"], .bpt input[type="date"], .bpt input[type="number"], .bpt select, .bpt textarea {
  width: 100%; border: 1px solid var(--line-strong); background: var(--surface-2); border-radius: 7px; padding: 7px 9px; min-height: 36px; box-shadow: none;
}
.bpt textarea { min-height: 70px; resize: vertical; line-height: 1.4; }
.bpt input:focus, .bpt select:focus, .bpt textarea:focus { border-color: var(--accent); background: var(--surface); outline: none; }
.bpt-check { display: flex; gap: 8px; align-items: flex-start; font-size: 13.5px; cursor: pointer; }
.bpt-check input { margin-top: 3px; accent-color: var(--accent); }
.bpt-seg { display: inline-flex; border: 1px solid var(--line-strong); border-radius: 8px; overflow: hidden; background: var(--surface-2); }
.bpt-seg button { appearance: none; border: 0; background: transparent; padding: 6px 11px; cursor: pointer; font-weight: 550; color: var(--ink-2); border-right: 1px solid var(--line); }
.bpt-seg button:last-child { border-right: 0; }
.bpt-seg button[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); }
.bpt-agebox { display: flex; justify-content: space-between; gap: 10px; background: var(--accent-soft); border-radius: 8px; padding: 8px 10px; font-size: 13.5px; }
.bpt-agebox b { font-variant-numeric: tabular-nums; }

/* hrubé skóry */
.bpt-raw { display: flex; flex-direction: column; }
.bpt-rrow { display: grid; grid-template-columns: 38px minmax(0, 1fr) 64px 54px; gap: 4px 8px; align-items: center; padding: 7px 0; border-top: 1px solid var(--line); }
.bpt-rrow:first-child { border-top: 0; }
.bpt-code { font-family: var(--mono); font-weight: 700; font-size: 13px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 6px; text-align: center; padding: 3px 0; }
.bpt-rname { min-width: 0; }
.bpt-rname b { display: block; font-size: 14px; font-weight: 600; }
.bpt-rname small { color: var(--muted); font-size: 12px; }
.bpt-rrow input[type="number"] { text-align: right; font-size: 16px; font-weight: 650; font-variant-numeric: tabular-nums; padding-right: 6px; }
.bpt-rrow.err input { border-color: var(--high); background: var(--high-bg); }
.bpt-vs { grid-column: 4; grid-row: 1; display: flex; flex-direction: column; gap: 4px; align-self: center; }
.bpt-vsv { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 40px; border-radius: 8px; font-size: 20px; font-weight: 750; line-height: 1; font-variant-numeric: tabular-nums; }
.bpt-vsv small { font-size: 9.5px; font-weight: 650; letter-spacing: .04em; margin-bottom: 2px; opacity: .85; }
.bpt-vsv.age { background: var(--age); color: #fff; }
.bpt-vsv.grade { background: var(--grade); color: #fff; }
.bpt-vs:has(.bpt-vsv + .bpt-vsv) .bpt-vsv { min-height: 30px; font-size: 16px; }
.bpt-chip { display: inline-flex; align-items: center; gap: 5px; border-radius: 999px; padding: 1px 8px; background: var(--surface-2); border: 1px solid var(--line); font-variant-numeric: tabular-nums; }
.bpt-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex: none; }
.bpt-dot.age { background: var(--age); }
.bpt-dot.grade { background: var(--grade); transform: rotate(45deg); border-radius: 1px; }
.bpt-parts { grid-column: 2 / -1; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: 12.5px; }
.bpt-parts label { display: inline-flex; align-items: center; gap: 4px; color: var(--ink-2); }
.bpt-parts input[type="number"] { width: 58px; min-height: 30px; padding: 4px 6px; font-size: 13px; }
.bpt-link { appearance: none; border: 0; background: none; color: var(--accent); cursor: pointer; padding: 0; font-size: 12.5px; text-decoration: underline; text-underline-offset: 2px; }
.bpt-errmsg { grid-column: 2 / -1; color: var(--high); font-size: 12.5px; }
.bpt-ruler { margin-top: 8px; border: 1px dashed var(--line-strong); border-radius: 8px; padding: 8px 10px; font-size: 13px; color: var(--ink-2); }
.bpt-ruler b { color: var(--ink); }

/* výsledky */
.bpt-tabs { display: flex; flex-wrap: wrap; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 14px; }
.bpt-tab { appearance: none; border: 0; background: none; padding: 9px 12px; font-weight: 600; color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; font-size: 14.5px; }
.bpt-tab[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--accent); }
.bpt-bar { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.bpt-bar .grp { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; font-size: 13px; color: var(--ink-2); }
.bpt-ctx { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.bpt-ctx .bpt-chip { padding: 4px 10px; font-size: 13px; background: var(--surface); }
.bpt-notes { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.bpt-note { border-radius: 8px; padding: 8px 12px; font-size: 13.5px; background: var(--info-bg); display: flex; gap: 8px; }
.bpt-note.warn { background: var(--mild-bg); }
.bpt-note::before { content: "i"; flex: none; width: 18px; height: 18px; border-radius: 50%; display: inline-grid; place-items: center; font-weight: 800; font-size: 11px; background: var(--accent); color: var(--accent-ink); margin-top: 1px; }
.bpt-note.warn::before { content: "!"; background: var(--mild); color: var(--surface); }

.bpt-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-bottom: 14px; }
@container bpt (max-width: 620px) { .bpt-cards { grid-template-columns: minmax(0, 1fr); } }
.bpt-card { background: var(--surface); border: 1px solid var(--line-strong); border-top: 4px solid var(--accent); border-radius: var(--r); padding: 12px 14px; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.bpt-card .k { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.bpt-card .v { font-size: 34px; font-weight: 750; line-height: 1; font-variant-numeric: tabular-nums; }
.bpt-card .v small { font-size: 14px; font-weight: 550; color: var(--ink-2); margin-left: 6px; }
.bpt-card .s { font-size: 13px; color: var(--ink-2); }
.bpt-pill { display: inline-flex; align-items: center; gap: 6px; border-radius: 999px; padding: 2px 10px; font-size: 12.5px; font-weight: 650; width: fit-content; }
.bpt-pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.bpt-pill.ok { color: var(--ok); background: var(--ok-bg); }
.bpt-pill.mild { color: var(--mild); background: var(--mild-bg); }
.bpt-pill.mod { color: var(--mod); background: var(--mod-bg); }
.bpt-pill.high { color: var(--high); background: var(--high-bg); }
.bpt-pill.neutral { color: var(--ink-2); background: var(--surface-2); }

.bpt-sec { background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--r); padding: 14px; margin-bottom: 14px; min-width: 0; }
.bpt-sec h3 { font-size: 16px; font-weight: 700; margin-bottom: 4px; color: var(--accent); }
.bpt-sec .sub { color: var(--muted); font-size: 13px; margin-bottom: 10px; }
.bpt-legend { display: flex; flex-wrap: wrap; gap: 14px; font-size: 13px; color: var(--ink-2); margin: 4px 0 6px; }
.bpt-legend span { display: inline-flex; align-items: center; gap: 6px; }
.bpt-legend .ln { display: inline-block; width: 22px; height: 0; border-top: 2px solid var(--age); }
.bpt-legend .ln.grade { border-top: 2px dashed var(--grade); }
.bpt-legend .ln.band { height: 10px; border: 0; background: var(--band); }

.bpt-scroll { overflow-x: auto; min-width: 0; }
.bpt-t th { font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 700; border-bottom: 1px solid var(--line-strong); white-space: nowrap; }
.bpt-t td { border-bottom: 1px solid var(--line); }
.bpt-t tr:last-child td { border-bottom: 0; }
.bpt-t .n { text-align: center; }
.bpt-t .c { text-align: center; }
.bpt-t .g-age { box-shadow: inset 0 2px 0 var(--age); }
.bpt-t .g-grade { box-shadow: inset 0 2px 0 var(--grade); }
.bpt-t td.big { font-weight: 700; font-size: 15px; }
.bpt-t tr.hi td { background: var(--accent-soft); }
.bpt-t .muted { color: var(--muted); }
.bpt-yes { color: var(--ok); font-weight: 700; }
.bpt-no { color: var(--muted); }
.bpt-flag { display: inline-block; font-size: 11.5px; font-weight: 700; border-radius: 5px; padding: 1px 6px; background: var(--accent); color: var(--accent-ink); }

/* grafy */
.bpt-chart { position: relative; min-width: 0; }
.bpt-chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.bpt-chart text { font-family: var(--font); }
.bpt-tip { position: absolute; pointer-events: none; background: var(--ink); color: var(--surface); font-size: 12.5px; padding: 6px 9px; border-radius: 7px; white-space: nowrap; transform: translate(-50%, calc(-100% - 10px)); z-index: 5; line-height: 1.35; box-shadow: 0 4px 14px rgba(0,0,0,.18); }
.bpt-tip[hidden] { display: none; }
.bpt-hit { cursor: pointer; fill: transparent; }

.bpt-dd { display: grid; grid-template-columns: auto 1fr 1fr; gap: 4px; font-size: 12.5px; margin-top: 4px; }
.bpt-dd div { border-radius: 6px; padding: 5px 7px; background: var(--surface-2); text-align: center; }
.bpt-dd .h { background: none; color: var(--muted); font-weight: 650; }
.bpt-dd .on { background: var(--accent); color: var(--accent-ink); font-weight: 700; }

.bpt-empty { padding: 30px 18px; text-align: center; color: var(--muted); border: 1px dashed var(--line-strong); border-radius: var(--r); background: var(--surface); }
.bpt-empty b { display: block; color: var(--ink); font-size: 16px; margin-bottom: 6px; }

.bpt-banner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; align-items: center; background: var(--info-bg); border-radius: 8px; padding: 8px 12px; font-size: 13.5px; margin-bottom: 12px; }
.bpt-foot { color: var(--muted); font-size: 12px; margin-top: 14px; }
.bpt-hiddenfile { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }

/* protokol (náhled A4) */
.bpt-sheetwrap { overflow-x: auto; background: var(--surface-2); border-radius: var(--r); padding: 16px; border: 1px solid var(--line); }
.bpt-sheet { --s-ink: #111; --s-mute: #555; --s-line: #c9c9c9; --s-age: #2a78d6; --s-grade: #d9571f;
  width: 186mm; max-width: 100%; margin: 0 auto; background: #fff; color: var(--s-ink); padding: 14mm 12mm; box-shadow: 0 2px 16px rgba(0,0,0,.08);
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; font-size: 10pt; line-height: 1.35; color-scheme: light; text-align: left; }
.bpt-sheet * { box-sizing: border-box; }
.bpt-sheet h1, .bpt-sheet h2, .bpt-sheet p { font-family: inherit; color: var(--s-ink); letter-spacing: 0; text-transform: none; }
.bpt-sheet h1 { font-size: 15pt; font-weight: 750; margin: 0 0 2mm; }
.bpt-sheet h2 { font-size: 11pt; font-weight: 700; margin: 5mm 0 2mm; padding-bottom: 1mm; border-bottom: 1.5px solid var(--s-ink); break-after: avoid; }
.bpt-sheet .meta { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5mm 6mm; font-size: 9.5pt; }
.bpt-sheet .meta div span { color: var(--s-mute); display: block; font-size: 8pt; text-transform: uppercase; letter-spacing: .05em; }
.bpt-sheet table { border-collapse: collapse; width: 100%; font-variant-numeric: tabular-nums; }
.bpt-sheet th, .bpt-sheet td { border-bottom: .5pt solid var(--s-line); padding: 1.3mm 1.6mm; font-size: 9pt; text-align: left; color: var(--s-ink); background: none; }
.bpt-sheet th { font-size: 7.5pt; text-transform: uppercase; letter-spacing: .04em; color: var(--s-mute); border-bottom: 1pt solid var(--s-ink); }
.bpt-sheet .n { text-align: center; } .bpt-sheet .c { text-align: center; white-space: nowrap; }
.bpt-sheet .charts { display: grid; grid-template-columns: 1fr; gap: 3mm; margin-top: 4mm; }
.bpt-sheet .charts svg { max-height: 70mm; }
.bpt-sheet .two { display: grid; grid-template-columns: 1fr 1fr; gap: 6mm; }
.bpt-sheet .box { border: .5pt solid var(--s-line); border-radius: 2mm; padding: 2.5mm 3mm; break-inside: avoid; }
.bpt-sheet .txt { white-space: pre-wrap; min-height: 14mm; }
.bpt-sheet .small { font-size: 8pt; color: var(--s-mute); }
.bpt-sheet .chart { break-inside: avoid; }
.bpt-sheet .chart svg { width: 100%; height: auto; }
.bpt-sheet .sign { display: grid; grid-template-columns: 1fr 1fr; gap: 10mm; margin-top: 10mm; font-size: 9pt; }
.bpt-sheet .sign div { border-top: .5pt solid var(--s-ink); padding-top: 1.5mm; color: var(--s-mute); }
.bpt-sheet .keep { break-inside: avoid; }
.bpt-sheet .tag { font-weight: 700; }

@media print {
  html.bpt-printing body > *:not(#bpt-print-root) { display: none !important; }
  html.bpt-printing body { background: #fff !important; margin: 0 !important; padding: 0 !important; }
  html.bpt-printing, html.bpt-printing body { height: auto !important; overflow: visible !important; }
  #bpt-print-root .bpt-sheet { width: auto; max-width: none; margin: 0; padding: 0; box-shadow: none; }
  #bpt-print-root { display: block !important; }
  @page { size: A4; margin: 14mm 12mm; }
}
#bpt-print-root { display: none; }
@media (prefers-reduced-motion: no-preference) { .bpt-btn, .bpt-tab, .bpt-seg button { transition: background .15s, border-color .15s, color .15s; } }

.bpt-lvl { display: inline-block; font-size: 12.5px; font-weight: 600; padding: 1px 8px; border-radius: 999px; white-space: nowrap; background: var(--surface-2); color: var(--ink-2); border: 1px solid var(--line); }
.bpt-lvl.l1, .bpt-lvl.l2 { background: var(--high-bg); color: var(--high); border-color: transparent; }
.bpt-lvl.l3 { background: var(--mild-bg); color: var(--mild); border-color: transparent; }
.bpt-lvl.l5, .bpt-lvl.l6, .bpt-lvl.l7 { background: var(--accent-soft); color: var(--accent); border-color: transparent; }
.bpt-ixdesc { display: block; font-size: 12.5px; color: var(--muted); font-weight: 400; margin-top: 2px; max-width: 46ch; }
.bpt-levels { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; font-size: 12px; color: var(--muted); align-items: center; }
.bpt-ixgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px 18px; margin-top: 8px; }
.bpt-ixgrid div { border-left: 3px solid var(--accent); padding: 2px 0 2px 10px; min-width: 0; }
.bpt-ixgrid p { font-size: 13px; color: var(--ink-2); margin-top: 2px; }

.bpt-root.alignwide { max-width: min(1400px, 100%); }
.bpt-dd .h { white-space: nowrap; font-size: 11.5px; }

/* export do PDF */
.bpt-export { margin: 18px 0; padding: 16px 18px; border: 2px solid var(--accent); border-radius: var(--r); background: var(--surface-2); }
.bpt-export h3 { margin: 0 0 2px; }
.bpt-export-opts { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 6px 14px; margin: 10px 0 14px; }
.bpt-export-btn { font-size: 16px; font-weight: 700; padding: 12px 22px; min-height: 48px; }
.bpt-export-hint { margin-top: 8px; }
.bpt .bpt-tabpdf { margin-left: auto; align-self: center; margin-bottom: 4px; }
/* hrubé skóry se píšou ručně: bez šipek */
.bpt input[type="number"] { -moz-appearance: textfield; appearance: textfield; }
.bpt input[type="number"]::-webkit-inner-spin-button, .bpt input[type="number"]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.bpt-t td:first-child { white-space: nowrap; }
