/* Precipitate Predictor: The Precipitate Bench inside the practice shell's stage (about 1066 x 628 at 1366 x 768). */
.pp { position: absolute; inset: 0; overflow: auto; display: grid; grid-template-columns: minmax(0, 440px) minmax(0, 1fr); gap: 12px; padding: 10px 12px; font-size: 16px; line-height: 1.3;
  color: #1f2933; background: linear-gradient(#efe7dc, #e2d6c7);
}
html[data-theme="dark"] .pp { color: #eef2f6; background: linear-gradient(#1d1915, #16130f);
}
.pp *, .pp *::before, .pp *::after { box-sizing: border-box; }
.pp p { margin: 0; }

/* colours: the stage, the Briefing example and the Start art all use them */
.pp, .pp-example, .pp-start {--pp-card: #ffffff; --pp-line: #b9aa98; --pp-soft: #4d4339; --pp-accent: #8a4b12; --pp-head: #f6efe6; --pp-in: #ffffff;
  --pp-ok: #1f7a44; --pp-ok-bg: #e3f6e8; --pp-bad: #b42318; --pp-bad-bg: #fde7e4;
  --pp-wall: #dfe9f0; --pp-bench: #6b5242; --pp-bench-edge: #8a6c58; --pp-glass: #7d97aa; --pp-text: #1f2933; --pp-zoom: #4a6378; }
html[data-theme="dark"] .pp, html[data-theme="dark"] .pp-example, html[data-theme="dark"] .pp-start {--pp-card: #26211c; --pp-line: #6b5d4e; --pp-soft: #d8cdbf; --pp-accent: #f0b27a; --pp-head: #312a23; --pp-in: #15120f;
  --pp-ok: #7fdca0; --pp-ok-bg: #173d27; --pp-bad: #ffb4a8; --pp-bad-bg: #4a1e1a;
  --pp-wall: #233140; --pp-bench: #3e2f25; --pp-bench-edge: #5b4536; --pp-glass: #a9c2d4; --pp-text: #eef2f6; --pp-zoom: #9fbad0; }

/* art (classes inside art.js's SVG) */
.pp-svg { display: block; width: 100%; height: auto; }
.pp-wall { fill: var(--pp-wall); }
.pp-bench { fill: var(--pp-bench); }
.pp-bench-edge { fill: var(--pp-bench-edge); }
.pp-shadow { fill: #000; opacity: .22; }
.pp-grad { stroke: #6b8396; stroke-width: 1.5; }
.pp-glass { stroke: var(--pp-glass); stroke-width: 2.2; }
.pp-t { font: 800 24px/1 system-ui, sans-serif; fill: var(--pp-text); }
.pp-arrow { fill: none; stroke: var(--pp-zoom); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.pp-zoom { fill: none; stroke: var(--pp-zoom); stroke-width: 2; stroke-dasharray: 6 5; }
.pp-cu-rim { stroke: #40576b; stroke-width: 7; }
html[data-theme="dark"] .pp-cu-rim { stroke: #8fa8bd; }
.pp-cu-floor { fill: #9fb7c6; opacity: .35; }
.pp-ring { stroke: #1d5fa8; stroke-width: 2.2; stroke-dasharray: 4 3; }
/* the reveal: grains drift down and the layer builds up (no motion with prefers-reduced-motion) */
.pp-anim .pp-cloud { animation: pp-fall 1.6s ease-out both; }
.pp-anim .pp-settle { animation: pp-grow 1.8s ease-out both; transform-box: fill-box; transform-origin: 50% 100%; }
.pp-anim .pp-closeup .pp-lattice { animation: pp-fade 1.2s .3s ease-out both; }
@keyframes pp-fall { from { transform: translateY(-26px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes pp-grow { from { transform: scaleY(0); } to { transform: none; } }
@keyframes pp-fade { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .pp-anim .pp-cloud, .pp-anim .pp-settle, .pp-anim .pp-closeup .pp-lattice { animation: none; } }

/* left: the bench */
.pp-left { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.pp-pic { border-radius: 12px; overflow: hidden; border: 1.5px solid var(--pp-line); background: var(--pp-wall); }
.pp-cap { display: flex; flex-direction: column; gap: 4px; background: var(--pp-card); border: 1.5px solid var(--pp-line); border-radius: 12px; padding: 7px 10px; }
.pp-cap-l { display: flex; gap: 8px; align-items: baseline; line-height: 1.25; }
.pp-tagb { flex: none; display: inline-grid; place-items: center; min-width: 26px; height: 26px; border-radius: 6px; background: var(--pp-head); border: 1.5px solid var(--pp-line); font-weight: 800; }
.pp-result { font-weight: 800; color: var(--pp-accent); }
.pp-key { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; color: var(--pp-soft); }
.pp-key-k { font-weight: 800; color: inherit; }
.pp-key-i { display: inline-flex; align-items: center; gap: 5px; font-weight: 700; color: var(--pp-text); }
.pp-sw { width: 18px; height: 18px; border-radius: 50%; border: 2px solid; flex: none; }
.pp-key-n { font-style: italic; }

/* right: the worksheet */
.pp-sheet { min-width: 0; display: flex; flex-direction: column; gap: 4px; background: var(--pp-card); border: 1.5px solid var(--pp-line); border-radius: 14px; padding: 7px 12px; box-shadow: 0 6px 16px rgba(40, 25, 10, .12); align-self: start; }
.pp-eq { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 2px 10px; padding: 5px 10px; background: var(--pp-head); border: 1.5px solid var(--pp-line); border-radius: 10px; }
.pp-eq-t { font-size: 17px; font-weight: 800; }
.pp-ksp { font-size: 17px; white-space: nowrap; }
.pp-ksp-s { color: var(--pp-soft); }
.pp-steps { display: flex; flex-direction: column; gap: 4px; }
.pp-st { display: flex; flex-direction: column; gap: 2px; }
.pp-step { display: flex; align-items: center; gap: 8px; line-height: 1.25; }
.pp-num { flex: none; width: 28px; height: 28px; border-radius: 50%; display: inline-grid; place-items: center; background: var(--pp-accent); color: #fff; font-weight: 800; font-size: 16px; }
html[data-theme="dark"] .pp-num { color: #241405; }
.pp-step-s { color: var(--pp-soft); }
.pp-line { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 18px; padding-left: 36px; }
.pp-row { display: inline-flex; align-items: center; gap: 8px; flex-wrap: nowrap; min-width: 0; max-width: 100%; }
.pp-pre { font-weight: 800; white-space: nowrap; }
.pp-sci { display: inline-flex; flex-wrap: wrap; align-items: flex-start; gap: 3px; min-width: 0; }
.pp-x { align-self: center; font-weight: 800; font-size: 18px; margin: 0 1px 0 3px; white-space: nowrap; }
.pp .pp-in { height: 44px; padding: 0 6px; font: inherit; font-size: 18px; font-weight: 700; text-align: center; color: inherit; background: var(--pp-in); border: 2px solid var(--pp-accent); border-radius: 8px; }
.pp .pp-m { width: 76px; }
.pp .pp-e { width: 52px; font-size: 17px; }
/* the exponent box sits raised: the number box, × 10 and the unit drop 8px instead, so nothing rises into the line above */
.pp .pp-m, .pp-sci > .pp-x, .pp-sci > .pp-unit, .pp-sci > .pp-mark { margin-top: 7px; }
.pp-unit { align-self: center; font-weight: 800; margin-left: 4px; }
.pp-mark { align-self: center; font-weight: 800; white-space: nowrap; margin-left: 4px; }
.pp-mark:empty { display: none; }
.pp-mark.is-ok { color: var(--pp-ok); }
.pp-mark.is-bad { color: var(--pp-bad); }
.pp .pp-in.is-ok { border-color: var(--pp-ok); background: var(--pp-ok-bg); }
.pp .pp-in.is-bad { border-color: var(--pp-bad); background: var(--pp-bad-bg); }
.pp .pp-in:focus-visible, .pp .pp-chip:focus-visible { outline: 3px solid var(--tlg-focus, #b84c00); outline-offset: 2px; }
.pp-unitpick { display: inline-flex; align-items: center; gap: 8px; }
.pp-chips { display: flex; flex-wrap: wrap; gap: 6px 8px; padding-left: 36px; }
.pp-unitpick .pp-chips { padding-left: 0; }
.pp .pp-chip { min-height: 44px; display: inline-flex; align-items: center; gap: 6px; font-size: 17px; font-weight: 700; padding: 4px 14px; color: inherit; background: var(--pp-in); }
.pp .pp-chip[aria-checked="true"] { background: var(--pp-accent); border-color: var(--pp-accent); color: #fff; }
html[data-theme="dark"] .pp .pp-chip[aria-checked="true"] { color: #241405; }
.pp-chips--wide.pp-chips--n4 { display: grid; grid-template-columns: 1fr 1fr; }
.pp-chip-m:empty { display: none; }
.pp .pp-chip.is-right { border-color: var(--pp-ok); box-shadow: inset 0 0 0 2px var(--pp-ok); }
.pp .pp-chip.is-right:not([aria-checked="true"]) { background: var(--pp-ok-bg); color: var(--pp-ok); }
.pp .pp-chip.is-wrong { border-color: var(--pp-bad); background: var(--pp-bad-bg); color: var(--pp-bad); }
.pp .pp-chip:disabled { opacity: 1; cursor: default; }
.pp-why { border: 1.5px solid var(--pp-line); border-left: 5px solid var(--pp-accent); border-radius: 10px; padding: 4px 10px; background: var(--pp-head); }
.pp-why-k { font-weight: 800; color: var(--pp-accent); }
.pp-why-l { margin: 2px 0 0; padding-left: 22px; line-height: 1.3; }
.pp-why-l li + li { margin-top: 2px; }
.pp-msg { font-weight: 700; color: var(--pp-bad); }
.pp-howto { color: var(--pp-soft); line-height: 1.25; }
.pp.is-revealed .pp-howto { display: none; }
/* the calculator opens over the lower customer column (empty while working), not over the worksheet; reveal() closes it */
@media (min-width: 901px) { .ps .ps-calc, .ps-calc { right: auto; left: 30px; bottom: 76px; } }
.pp-msg:empty { display: none; }

/* Briefing example and Start art */
.pp-example .pp-svg { max-height: 420px; }
.pp-start .pp-svg { border-radius: 14px; }

/* tablets and phones: the bench above the worksheet, the page scrolls */
@media (max-width: 1100px) {
  .pp { grid-template-columns: minmax(0, 320px) minmax(0, 1fr); }
  .pp-line { padding-left: 0; }
  .pp-chips { padding-left: 0; }
}
@media (max-width: 900px) {
  .pp { position: static; display: flex; flex-direction: column; overflow: visible; }
  .pp-left { max-width: 520px; width: 100%; margin: 0 auto; }
}
@media (max-width: 480px) {
  .pp { padding: 8px; }
  .pp-sheet { padding: 8px; }
  .pp-chips--wide.pp-chips--n4 { grid-template-columns: 1fr; }
  .pp .pp-m { width: 70px; }
}
/* after Check the marks win over the "picked" fill in both themes (the dark picked-chip ink is dark) */
html .pp .pp-chip.is-wrong, html[data-theme="dark"] .pp .pp-chip.is-wrong { border-color: var(--pp-bad); background: var(--pp-bad-bg); color: var(--pp-bad); }
html[data-theme="dark"] .pp .pp-chip.is-right[aria-checked="true"] { color: #241405; }
