/* Strona vademecum.html. Kolory i krój są te same co w kalkulatorze; zmienne --pg-* są w koszt-odchowu-page.css. */
.vm { box-sizing: border-box; width: 100%; max-width: 1112px; margin: 0 auto; padding: 24px 16px 40px; display: grid; gap: 32px;
  font-size: 15px; line-height: 1.5; color: var(--pg-ink); }
.vm *, .vm *::before, .vm *::after { box-sizing: border-box; }
.vm > * { min-width: 0; }
.vm :focus-visible { outline: 2px solid var(--pg-focus); outline-offset: 2px; }

.vm h1 { font-stretch: 125%; font-weight: 800; font-size: clamp(28px, 5vw, 46px); line-height: 1; letter-spacing: -.01em; margin: 0; text-wrap: balance; }
.vm header { display: grid; gap: 10px; }
.vm header p { margin: 0; color: var(--pg-muted); max-width: 60ch; }
.vm h2 { font-stretch: 112%; font-weight: 700; font-size: 22px; margin: 0; text-wrap: balance; }
.vm .band { display: grid; gap: 14px; }
.vm .band > * { min-width: 0; }
.vm .band > p { margin: 0; color: var(--pg-muted); max-width: 70ch; }

/* the cycle as a bar: each segment is as wide as the days its weight range takes */
.vm .scale { display: flex; gap: 3px; }
.vm .seg { flex: 1 1 0; min-width: 0; background: var(--pg-tag); color: var(--pg-tag-ink); padding: 10px 12px; display: grid; gap: 1px; overflow: hidden; }
.vm .seg:first-child { border-radius: 10px 0 0 10px; }
.vm .seg:last-child { border-radius: 0 10px 10px 0; }
.vm .seg b { font-weight: 800; font-size: 16px; line-height: 1.2; white-space: nowrap; }
.vm .seg span { font-size: 13px; white-space: nowrap; }
@media (max-width: 480px) {
  .vm .seg { padding: 8px 6px; }
  .vm .seg b { font-size: 12.5px; }
  .vm .seg span { font-size: 12px; }
}

.vm .scroll { overflow-x: auto; }
.vm table { border-collapse: collapse; width: 100%; min-width: 560px; font-variant-numeric: tabular-nums; background: var(--pg-panel); border: 1px solid var(--pg-line); }
.vm table.narrow { min-width: 420px; max-width: 720px; }
.vm th, .vm td { padding: 9px 12px; text-align: right; border-bottom: 1px solid var(--pg-line); vertical-align: top; }
.vm thead th { font-weight: 600; font-size: 13.5px; color: var(--pg-muted); vertical-align: bottom; }
.vm thead th.l, .vm tbody th { text-align: left; }
.vm tbody th { font-weight: 400; }
/* on a narrow screen the table scrolls sideways; the range name stays in view */
.vm thead th.l, .vm tbody th { position: sticky; left: 0; background: var(--pg-panel); }
.vm tr.total th, .vm tr.total td { font-weight: 800; border-top: 2px solid var(--pg-ink); font-size: 16px; }
.vm tr.sum th, .vm tr.sum td { color: var(--pg-muted); }
.vm tr.bad td:last-child { color: var(--pg-worse); font-weight: 700; }
.vm td small { display: block; font-size: 12.5px; font-weight: 400; color: var(--pg-worse); }
.vm tbody th small { display: block; font-size: 12.5px; font-weight: 400; color: var(--pg-muted); white-space: nowrap; }
.vm tbody th small.off { color: var(--pg-worse); }
/* the crowding chain: numbered steps from the pigs in the barn down to the yearly loss; the slider's column stands out */
.vm tr.step th { font-weight: 700; padding-top: 14px; }
.vm tr.step b { display: inline-grid; place-items: center; width: 22px; height: 22px; margin-right: 8px; border-radius: 50%;
  background: var(--pg-tag); color: var(--pg-tag-ink); font-size: 13px; font-weight: 800; }
.vm #chain thead th:nth-child(2) { color: var(--pg-ink); }
.vm #chain td:first-of-type { font-weight: 700; }
.vm .band > .alert { margin: 0; max-width: 75ch; color: var(--pg-ink); font-weight: 600; border-left: 4px solid var(--pg-worse); padding-left: 12px; }
.vm .alert[hidden] { display: none; }

.vm .win { margin: 0; padding: 16px 22px; border-radius: 4px; background: var(--pg-panel); border: 1px solid var(--pg-line); color: var(--pg-ink);
  font-weight: 600; font-size: clamp(20px, 3.2vw, 30px); line-height: 1.15; text-wrap: balance; max-width: none; }
.vm .win b { font-weight: 800; }

/* a slider with its value in large type: floor area and barn temperature */
.vm .dial { background: var(--pg-panel); border: 1px solid var(--pg-line); border-radius: 4px; padding: 16px 22px; display: grid; gap: 8px; }
.vm .dial label { font-size: 14px; color: var(--pg-muted); }
.vm .dial-row { display: flex; align-items: center; gap: 18px; }
.vm .dial input { flex: 1; min-width: 0; margin: 0; height: 32px; accent-color: var(--pg-tag); cursor: pointer; }
.vm .dial output { flex: none; min-width: 4.2ch; text-align: right; font-stretch: 75%; font-weight: 800; font-size: clamp(30px, 5vw, 40px); line-height: 1; font-variant-numeric: tabular-nums; white-space: nowrap; }

/* two sliders side by side: the barn's pen floor and the floor per pig */
.vm .dials { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.vm .dials > * { min-width: 0; }
@media (max-width: 760px) { .vm .dials { grid-template-columns: 1fr; } }

.vm h3 { font-stretch: 112%; font-weight: 700; font-size: 18px; margin: 10px 0 0; text-wrap: balance; }

/* sources stay folded until asked for */
.vm .src summary { cursor: pointer; font-stretch: 112%; font-weight: 700; font-size: 18px; color: var(--pg-muted); }
.vm .src[open] summary { color: var(--pg-ink); }
.vm .src .notes { margin-top: 14px; }

.vm .notes { font-size: 14px; color: var(--pg-muted); max-width: 75ch; display: grid; gap: 6px; text-wrap: pretty; }
.vm .notes p { margin: 0; }
