/* Check-your-answer panel: questions beside their own small sample problem (scripts/check-panel.js).
   Reusable on any tool page; uses only theme variables from civil.css and the header height. */

.check-panel { display: grid; grid-template-columns: minmax(0, 1fr) minmax(280px, 380px); gap: 20px 28px; align-items: start; margin-top: 18px; }
.check-main { min-width: 0; }
.check-main .whatif-list { margin-top: 12px; }
.check-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; }
.check-example-label { color: var(--ink-muted); font-size: .86rem; }

.check-figure {
  position: sticky; top: calc(var(--header-height, 65px) + 16px); z-index: 5;
  max-height: calc(100vh - var(--header-height, 65px) - 32px); overflow: auto;
  border: 1px solid var(--border-line); background: var(--bg-card); padding: 10px 12px 12px;
}
.check-figure-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; color: var(--ink-muted); font: 700 .66rem/1.3 'IBM Plex Mono', monospace; letter-spacing: .1em; text-transform: uppercase; }
.check-figure-toggle { padding: 3px 9px; border: 1px solid var(--border-line); background: var(--bg-canvas); color: var(--ink); font: 700 .66rem/1.3 'IBM Plex Mono', monospace; letter-spacing: .08em; text-transform: uppercase; cursor: pointer; }
.check-figure.is-collapsed .check-figure-body { display: none; }
.check-figure.is-collapsed .check-figure-head { margin-bottom: 0; }
.check-figure-body > * + * { margin-top: 10px; }
.check-figure svg { display: block; width: 100%; height: auto; }

/* Phones and narrow tablets: the figure sits above the questions, still in view, and can fold away. */
@media (max-width: 900px) {
  .check-panel { grid-template-columns: minmax(0, 1fr); }
  .check-figure { order: -1; top: calc(var(--header-height, 55px) + 6px); max-height: 46vh; box-shadow: 0 6px 14px rgba(0, 0, 0, .08); }
}

/* Small figures drawn by scripts/practice-problems.js, and a table of the givens. */
.pf-svg { font-family: 'IBM Plex Mono', monospace; }
.pf-label { fill: var(--ink); font-size: 11px; font-weight: 700; }
.pf-val, .pf-tick { fill: var(--ink-muted); font-size: 10px; font-weight: 600; }
.pf-grid { stroke: var(--border-line); }
.pf-bar { fill: var(--ink-muted); }
.pf-bar.is-total { fill: none; stroke: var(--ink-muted); stroke-width: 1.2; stroke-dasharray: 3 3; }
.pf-bar.is-pv { fill: var(--c-blue); }
.pf-bar.is-ev { fill: var(--c-green); }
.pf-bar.is-ac { fill: var(--c-orange); }
.pf-range { fill: rgba(var(--rgb-blue), .22); stroke: var(--c-blue); stroke-width: 1; }
.pf-ml { stroke: var(--ink); stroke-width: 2.2; }
.pf-key { color: var(--ink-muted); font-size: .76rem; }
.check-givens { width: 100%; border-collapse: collapse; font-size: .8rem; }
.check-givens th { text-align: left; padding: 4px 6px; color: var(--ink-muted); font: 700 .62rem/1.3 'IBM Plex Mono', monospace; letter-spacing: .06em; text-transform: uppercase; border-bottom: 1px solid var(--border-line); }
.check-givens td { padding: 4px 6px; border-bottom: 1px solid var(--border-line); font-family: 'IBM Plex Mono', monospace; font-weight: 600; white-space: nowrap; }
.check-givens td:first-child { white-space: normal; font-family: inherit; }

/* Network figure (CPM). */
.pf-node { fill: var(--bg-canvas); stroke: var(--ink); stroke-width: 1.3; }
.pf-link { fill: none; stroke: var(--ink-muted); stroke-width: 1.3; }
.pf-head { fill: var(--ink-muted); }

/* Answer rows, for pages that do not load evm.css (same rules as there). */
.check-panel .q-answer { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 12px; }
.check-panel .q-answer input[type=text] { width: 140px; font-family: 'IBM Plex Mono', monospace !important; }
.check-panel .q-mark { font-weight: 700; font-size: .88rem; }
.check-panel .q-mark.ok { color: var(--c-green); }
.check-panel .q-mark.bad { color: var(--c-orange); }
.check-panel .q-explain { margin-top: 10px; padding: 10px 13px; background: var(--bg-canvas); box-shadow: var(--shadow-inset-ao); color: var(--ink-muted); font-size: .88rem; line-height: 1.6; }
.check-panel .q-explain[hidden] { display: none; }
@media (max-width: 640px) { .check-panel .q-answer input[type=text] { width: 100%; } }

/* Monte Carlo runs figure. */
.pf-bar.is-a { fill: var(--c-blue); }
.pf-bar.is-b { fill: var(--c-green); }
.pf-bar.is-risk { fill: var(--c-orange); }
.pf-target { stroke: var(--ink); stroke-width: 1.4; stroke-dasharray: 4 3; }
.check-figure-body .pf-key { margin: 0; }
