/* Water Potential Workshop: the Osmosis Bench inside the practice shell's stage (about 1066 x 628 at 1366 x 768). */
.wpw { position: absolute; inset: 0; overflow: auto; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.04fr); gap: 12px; padding: 10px 12px; font-size: 16px; line-height: 1.3;
  color: #1f2933; background: linear-gradient(#e7f0f4, #d6e4ea);
  --wpw-card: #ffffff; --wpw-line: #a9b8c4; --wpw-soft: #44525f; --wpw-accent: #1f6f8b; --wpw-head: #e3eef3; --wpw-in: #ffffff;
  --wpw-ok: #1f7a44; --wpw-ok-bg: #e3f6e8; --wpw-bad: #b42318; --wpw-bad-bg: #fde7e4; --wpw-pick: #dff1f7; }
html[data-theme="dark"] .wpw { color: #eef2f6; background: linear-gradient(#18222b, #121a21);
  --wpw-card: #212c37; --wpw-line: #56657a; --wpw-soft: #c9d3de; --wpw-accent: #8fd0e6; --wpw-head: #2a3946; --wpw-in: #121820;
  --wpw-ok: #7fdca0; --wpw-ok-bg: #173d27; --wpw-bad: #ffb4a8; --wpw-bad-bg: #4a1e1a; --wpw-pick: #1d4252; }
.wpw *, .wpw *::before, .wpw *::after { box-sizing: border-box; }
.wpw p { margin: 0; }
.wpw sub { font-size: 16px; line-height: 1; vertical-align: baseline; position: relative; top: .2em; }
.wpw-eq-main { margin-bottom: 4px !important; }

/* ── art (SVG classes; also used by the Briefing example, the Start art and the thumbnail) ── */
.wpw-svg { display: block; max-width: 100%; height: auto; overflow: visible; }
.wpw-t { font-family: system-ui, -apple-system, "Segoe UI", sans-serif; font-size: 16px; fill: #1f2933; }
.wpw-b { font-weight: 700; }
.wpw-big { font-weight: 800; fill: #17324a; }
.wpw-liquid { fill: url(#wpw-water); }
.wpw-meniscus { fill: none; stroke: #5b9dc4; }
.wpw-glass { fill: none; stroke: #8ea9bb; stroke-linecap: round; stroke-linejoin: round; opacity: .95; }
.wpw-shine { fill: none; stroke: #ffffff; stroke-opacity: .85; stroke-linecap: round; }
.wpw-shadow { fill: #000; opacity: .12; }
.wpw-grad { stroke: #8ea9bb; }
.wpw-membrane { fill: #d8b46a; stroke: #8a6a2a; stroke-width: 1.5; }
.wpw-pore { fill: #fff8e6; }
.wpw-sugar { fill: #f6d58c; stroke: #a86f12; }
.wpw-cation { fill: #9b6ad6; stroke: #4f2d86; }
.wpw-cation2 { fill: #d6649b; stroke: #7d2453; }
.wpw-cation3 { fill: #e08a3c; stroke: #8a4a0e; }
.wpw-anion { fill: #57b56b; stroke: #1f6a32; }
.wpw-flow { fill: none; stroke: #0d5fa3; stroke-linecap: round; marker-end: url(#wpw-head); }
.wpw-flow-halo { fill: none; stroke: #ffffff; stroke-opacity: .9; stroke-linecap: round; }
.wpw-on-cell { fill: #17324a !important; }
.wpw-flow--thin { stroke-width: 4px; }
.wpw-startline { stroke: #44525f; stroke-dasharray: 6 5; }
.wpw-wall { fill: #b7d78f; stroke: #4d7f2a; }
.wpw-gap { fill: url(#wpw-water); }
.wpw-cyto { fill: url(#wpw-cyto); stroke: #6b8f3e; }
.wpw-vac { fill: url(#wpw-vac); stroke: #8796c4; }
.wpw-nuc { fill: url(#wpw-nuc); stroke: #5d3a85; }
.wpw-nucleolus { fill: #4f2d73; }
.wpw-chloro { fill: url(#wpw-chloro); stroke: #1d5a22; }
.wpw-grana { stroke: #1a4d1d; fill: none; }
.wpw-turgor { stroke: #8a5a1c; fill: none; stroke-linecap: round; }
.wpw-core { stroke: #8f7637; }
.wpw-core-end { fill: #fbf3d6; stroke: #8f7637; }
.wpw-core-end--sw { fill: #fbc58f; stroke: #9a4f15; }
.wpw-lab { font-size: 16px; }
.wpw-gain { fill: #1f6a3a; font-weight: 700; }
.wpw-loss { fill: #a1321f; font-weight: 700; }
.wpw-g-bg { fill: #fbfdff; stroke: #b8c6d2; }
.wpw-g-grid { stroke: #dbe4ec; stroke-width: 1; }
.wpw-g-zero { stroke: #44525f; stroke-width: 2; }
.wpw-g-axis { stroke: #1f2933; stroke-width: 2; fill: none; }
.wpw-g-t { font-size: 16px; }
.wpw-g-fit { stroke: #1f6f8b; stroke-width: 3; fill: none; }
.wpw-g-pt { fill: #ffffff; stroke: #17324a; stroke-width: 2.5; }
.wpw-g-drop { stroke: #b23a08; stroke-width: 2.5; stroke-dasharray: 6 5; fill: none; }
.wpw-g-x { fill: #e86a2a; stroke: #7a2a05; stroke-width: 2; }
html[data-theme="dark"] .wpw-t { fill: #eef2f6; }
html[data-theme="dark"] .wpw-big { fill: #dff1fb; }
html[data-theme="dark"] .wpw-liquid, html[data-theme="dark"] .wpw-gap { fill: url(#wpw-water-d); }
html[data-theme="dark"] .wpw-glass, html[data-theme="dark"] .wpw-grad { stroke: #9fb8c9; }
html[data-theme="dark"] .wpw-shine { stroke-opacity: .35; }
html[data-theme="dark"] .wpw-shadow { fill: #000; opacity: .45; }
html[data-theme="dark"] .wpw-meniscus { stroke: #7fc0e6; }
html[data-theme="dark"] .wpw-flow { stroke: #bfe8ff; marker-end: url(#wpw-head-d); }
html[data-theme="dark"] .wpw-flow-halo { stroke: #0b1a26; }
html[data-theme="dark"] .wpw-startline { stroke: #c9d3de; }
html[data-theme="dark"] .wpw-gain { fill: #8fe0a8; }
html[data-theme="dark"] .wpw-loss { fill: #ffb09e; }
html[data-theme="dark"] .wpw-g-bg { fill: #182129; stroke: #4c5d6d; }
html[data-theme="dark"] .wpw-g-grid { stroke: #2d3b48; }
html[data-theme="dark"] .wpw-g-zero { stroke: #c9d3de; }
html[data-theme="dark"] .wpw-g-axis { stroke: #dfe7ee; }
html[data-theme="dark"] .wpw-g-fit { stroke: #8fd0e6; }
html[data-theme="dark"] .wpw-g-pt { fill: #182129; stroke: #eef2f6; }
html[data-theme="dark"] .wpw-g-drop { stroke: #ff9a66; }
@media (prefers-reduced-motion: no-preference) {
  .wpw-flowg { animation: wpw-flow 1.4s ease-in-out infinite; }
  .wpw.is-revealed .wpw-art { animation: wpw-in .35s ease; }
}
@keyframes wpw-flow { 0%, 100% { opacity: 1; } 50% { opacity: .45; } }
@keyframes wpw-in { from { opacity: .4; } to { opacity: 1; } }

/* ── left: the bench ── */
.wpw-left { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.wpw-card { background: var(--wpw-card); border: 1.5px solid var(--wpw-line); border-radius: 12px; padding: 8px 11px; }
.wpw-k { font-size: 16px; font-weight: 800; color: var(--wpw-accent); }
.wpw-artbox { position: relative; min-width: 0; background: var(--wpw-card); border: 1.5px solid var(--wpw-line); border-radius: 14px; padding: 6px; display: flex; justify-content: center; }
.wpw-art { width: 100%; display: flex; justify-content: center; }
.wpw-sides { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.wpw-side { background: var(--wpw-card); border: 1.5px solid var(--wpw-line); border-radius: 12px; padding: 6px 10px; line-height: 1.3; min-width: 0; }
.wpw-side b { font-weight: 800; }
.wpw-side .wpw-k { display: flex; justify-content: space-between; gap: 6px; }
.wpw-psi { font-weight: 800; }
.wpw-psi--q { color: var(--wpw-accent); }
.wpw-note { font-size: 16px; color: var(--wpw-soft); line-height: 1.25; }
.wpw-legend { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 16px; color: var(--wpw-soft); }
.wpw-legend span { display: inline-flex; align-items: center; gap: 5px; }
.wpw-legend svg { width: 18px; height: 18px; flex: none; }
.wpw-graphbox { background: var(--wpw-card); border: 1.5px solid var(--wpw-line); border-radius: 14px; padding: 4px 4px 0; min-width: 0; }
.wpw-graphcap { padding: 4px 8px 6px; display: flex; flex-wrap: wrap; gap: 2px 14px; align-items: baseline; }
.wpw-fitline { font-weight: 800; font-size: 18px; }
.wpw-reveal { border-left: 5px solid var(--wpw-accent); }

/* ── right: the worksheet ── */
.wpw-sheet { min-width: 0; display: flex; flex-direction: column; gap: 8px; background: var(--wpw-card); border: 1.5px solid var(--wpw-line); border-radius: 14px; padding: 10px 12px; box-shadow: 0 6px 16px rgba(20, 35, 50, .12); align-self: start; }
.wpw-eq { background: var(--wpw-head); border: 1.5px solid var(--wpw-line); border-radius: 10px; padding: 7px 10px; line-height: 1.35; }
.wpw-eq-main { font-size: 20px; font-weight: 800; letter-spacing: .01em; }
.wpw-eq-sub { color: var(--wpw-soft); line-height: 1.5; }
.wpw-step { display: flex; align-items: flex-start; gap: 8px; line-height: 1.25; }
.wpw-num { flex: none; width: 28px; height: 28px; border-radius: 50%; display: inline-grid; place-items: center; background: var(--wpw-accent); color: #fff; font-weight: 800; font-size: 16px; }
html[data-theme="dark"] .wpw-num { color: #10202e; }
.wpw-step-t { padding-top: 3px; }
.wpw-step-s { color: var(--wpw-soft); }
.wpw-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding-left: 36px; }
.wpw-field { display: inline-flex; align-items: center; gap: 8px; font-weight: 800; white-space: nowrap; }
.wpw .wpw-in { width: 118px; height: 46px; padding: 0 8px; font: inherit; font-size: 20px; font-weight: 700; text-align: center; color: inherit; background: var(--wpw-in); border: 2px solid var(--wpw-accent); border-radius: 8px; }
.wpw .wpw-in:focus-visible, .wpw .wpw-chip:focus-visible { outline: 3px solid var(--tlg-focus, #b84c00); outline-offset: 2px; }
.wpw .wpw-in.is-ok { border-color: var(--wpw-ok); background: var(--wpw-ok-bg); }
.wpw .wpw-in.is-bad { border-color: var(--wpw-bad); background: var(--wpw-bad-bg); }
.wpw-fixed { font-weight: 700; }
.wpw-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.wpw .wpw-chip { min-height: 44px; min-width: 44px; padding: 6px 12px; font: inherit; font-size: 16px; font-weight: 700; color: inherit; background: var(--wpw-card); border: 2px solid var(--wpw-line); border-radius: 22px; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.wpw .wpw-chip[aria-checked="true"] { border-color: var(--wpw-accent); background: var(--wpw-pick); box-shadow: inset 0 0 0 1px var(--wpw-accent); }
.wpw .wpw-chip[aria-checked="true"]::before { content: "●"; color: var(--wpw-accent); font-size: 14px; }
.wpw .wpw-chip:disabled { cursor: default; }
.wpw .wpw-chip.is-right { border-color: var(--wpw-ok); background: var(--wpw-ok-bg); }
.wpw .wpw-chip.is-wrong { border-color: var(--wpw-bad); background: var(--wpw-bad-bg); }
.wpw-chip-m { font-weight: 900; }
.wpw-flowchips { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; padding-left: 36px; }
.wpw .wpw-flowchip { border-radius: 12px; flex-direction: column; justify-content: center; text-align: center; line-height: 1.15; padding: 6px 6px; min-height: 64px; }
.wpw .wpw-flowchip[aria-checked="true"]::before { content: none; }
.wpw-flowchip svg { width: 56px; height: 22px; flex: none; }
.wpw-flowchip .wpw-fa { stroke: currentColor; stroke-width: 3; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.wpw-mark { font-weight: 800; white-space: nowrap; }
.wpw-mark.is-ok { color: var(--wpw-ok); }
.wpw-mark.is-bad { color: var(--wpw-bad); }
.wpw-msg { min-height: 0; font-weight: 700; color: var(--wpw-bad); }
.wpw-msg:empty { display: none; }
.wpw-example { position: static; display: block; padding: 0; background: none; overflow: visible; }
.wpw-example .wpw-ex { display: grid; grid-template-columns: minmax(0, 260px) minmax(0, 1fr); gap: 12px; align-items: center; }
.wpw-example .wpw-ex-cards { display: grid; gap: 8px; }
.ps-brief--drawer .wpw-example .wpw-ex { grid-template-columns: 1fr; }
.wpw-startart { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; align-items: end; width: 100%; height: 100%; }
.wpw-startart > div { display: flex; justify-content: center; }

/* At 1366 x 768 everything fits without scrolling; the potato graph is sized from the space left. */
@media (min-width: 1181px) and (max-height: 820px) {
  .wpw-sides { gap: 6px; }
}
/* 1024 wide: still two columns (the worksheet stays in view); the data cards stack and the direction chips go one per row. */
@media (max-width: 1180px) {
  .wpw { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px; padding: 8px; }
  .wpw-sides { grid-template-columns: 1fr; gap: 6px; }
  .wpw-flowchips { grid-template-columns: 1fr; padding-left: 0; }
  .wpw .wpw-flowchip { flex-direction: row; min-height: 48px; justify-content: flex-start; text-align: left; }
  .wpw-row { padding-left: 0; }
}
/* Tablets and phones: the page scrolls; the bench sits above the worksheet. */
@media (max-width: 900px) {
  .wpw { position: static; overflow: visible; grid-template-columns: minmax(0, 1fr); align-content: start; }
  .wpw-sheet { align-self: stretch; }
  .wpw-sides { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 600px) {
  .wpw { padding: 8px; }
  .wpw-sides { grid-template-columns: 1fr; }
  .wpw-row, .wpw-flowchips { padding-left: 0; }
  .wpw-flowchips { grid-template-columns: 1fr; }
  .wpw .wpw-flowchip { flex-direction: row; min-height: 48px; justify-content: flex-start; text-align: left; }
  .wpw-sheet { padding: 8px; }
}
/* The calculator opens over the bench (left), not over the worksheet. */
@media (min-width: 901px) { .ps .ps-calc, .ps-calc { right: auto; left: 30px; bottom: 76px; } }
@media (min-width: 901px) { html.ps-locked .lga-card { right: auto !important; left: 12px; max-width: 276px; } }
