/* Park Ranger: the deer range field station. The range scene and herd monitor (activity.js) keep their own daylight /
 * board colours in both themes; the ledger, controls and work-order panel follow the site theme. */
html {
  --pr-accent: #3f6b45; --pr-accent-ink: #ffffff; --pr-card: #ffffff; --pr-ink: #1f3324; --pr-line: #9fb5a2;
  --pr-panel1: #f3f7f1; --pr-panel2: #e4ede1; --pr-ok: #13704a; --pr-bad: #b3261e; --pr-lock: #6b4a00; --pr-row: #f6faf4;
  --pr-future: #6a7a6c;
}
html[data-theme="dark"] {
  --pr-accent: #8fd19e; --pr-accent-ink: #10241a; --pr-card: #1f2a24; --pr-ink: #e6efe8; --pr-line: #4d6553;
  --pr-panel1: #1d2a22; --pr-panel2: #17221c; --pr-ok: #4fd08c; --pr-bad: #ff8a80; --pr-lock: #f4d35e; --pr-row: #223028;
  --pr-future: #9aaa9d;
}

.pr { position: absolute; inset: 0; display: grid; grid-template-columns: minmax(0, 1fr) 400px; gap: 10px; padding: 8px 10px;
  color: var(--pr-ink); font-size: 16px; overflow: hidden; }
.pr *, .pr *::before, .pr *::after { box-sizing: border-box; }
.pr p { margin: 0; line-height: 1.3; }
.pr input, .pr button, .pr output { font: inherit; font-size: 16px; }
.pr-left { display: flex; flex-direction: column; gap: 6px; min-width: 0; min-height: 0; }

/* scene */
.pr-scene { flex: none; min-width: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.pr-svg { display: block; height: auto; border-radius: 12px; box-shadow: 0 2px 6px rgba(0,0,0,.18); }
.pr-svg--land { flex: 330 1 0; min-width: 0; }
.pr-svg--chart { flex: 340 1 0; min-width: 0; }
.pr-svg text { font-family: var(--tlg-font, system-ui, sans-serif); }
.pr-svg .pr-t-sign { fill: #fff8ea; }
.pr-svg .pr-t-key { fill: #1f3324; }
.pr-svg .pr-t-k { fill: #9be7a8; letter-spacing: .06em; }
.pr-svg .pr-t-k2 { fill: #f2cc8f; font-weight: 700; }
.pr-svg .pr-t-dim { fill: #c4d6ca; font-variant-numeric: tabular-nums; }
.pr-svg .pr-t-v { fill: #ffffff; font-weight: 700; font-variant-numeric: tabular-nums; }
.pr-chip rect { stroke-width: 2; }
.pr-chip text { fill: #fff; }
.pr-chip.is-up rect { fill: #2f7a4a; stroke: #e9f7ec; }
.pr-chip.is-down rect { fill: #8c3b2a; stroke: #fbe9e4; }
.pr-goal { fill: #f2cc8f; opacity: .28; stroke: #f2cc8f; stroke-width: 1.5; }
.pr-goal.is-shown { opacity: .55; }
.pr-mark circle { stroke-width: 2; }
.pr-mark.is-ok circle { fill: #13704a; stroke: #e9f7ec; } .pr-mark.is-bad circle { fill: #b3261e; stroke: #fbe9e4; }
.pr-mark text { fill: #fff; }
.pr-stamp rect { fill: #ffffff; stroke: currentColor; }
.pr-stamp.is-ok { color: #13704a; } .pr-stamp.is-bad { color: #b3261e; }
.pr-stamp text { fill: currentColor; }
.pr-ledger:focus-visible { outline: 3px solid #b77a00; outline-offset: 2px; }

.pr-legend { display: flex; flex-wrap: wrap; gap: 2px 14px; font-size: 16px; line-height: 1.25; }
.pr-legend span { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.pr-sw { display: inline-block; width: 26px; height: 0; border-top: 4px solid #2f7a4a; }
.pr-sw--k { border-top: 3px dashed #c58b2c; }
.pr-sw--f { border-top: 3px dotted #c4583a; }
.pr-sw--g { height: 14px; border: 2px solid #c58b2c; background: rgba(242, 204, 143, .55); width: 14px; border-radius: 3px; }

/* ledger */
.pr-ledger { flex: none; min-width: 0; overflow-x: auto; }
.pr-ledger table { border-collapse: collapse; width: 100%; min-width: 600px; font-variant-numeric: tabular-nums; background: var(--pr-card); }
.pr-ledger caption { text-align: left; font-weight: 700; font-size: 16px; padding-bottom: 2px; caption-side: top; }
.pr-ledger th, .pr-ledger td { border: 1px solid var(--pr-line); padding: 1px 6px; text-align: right; line-height: 1.3; white-space: nowrap; }
.pr-ledger thead th { background: var(--pr-panel2); text-align: center; font-weight: 700; }
.pr-ledger tbody th { text-align: center; }
.pr-ledger tbody td:first-of-type { text-align: left; }
.pr-ledger tbody tr:nth-child(even) { background: var(--pr-row); }
.pr-ledger tr.is-future td { color: var(--pr-future); }
.is-data .pr-ledger td, .is-data .pr-ledger th { text-align: center; padding: 4px 6px; }
.pr-note { font-size: 16px; font-style: italic; }

/* plan controls */
.pr-bench { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.4fr); grid-template-areas: "permits habitat" "run run"; gap: 4px 12px; align-items: end; }
.pr-permits { grid-area: permits; display: grid; gap: 2px; min-width: 0; }
.pr-tiles--habitat { grid-area: habitat; }
.pr-runrow { grid-area: run; display: flex; align-items: center; gap: 8px; min-width: 0; }
.pr-modelnote { flex: 1 1 0; min-width: 0; font-size: 16px; font-style: italic; line-height: 1.25 !important; }
.pr-dot { display: inline-block; width: 10px; height: 10px; margin-right: 5px; border-radius: 50%; border: 2px solid currentColor; vertical-align: 0; }
.pr-tile.is-on .pr-dot { background: currentColor; }
.pr-permits-top { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.pr-permits-out { font-weight: 800; font-variant-numeric: tabular-nums; }
.pr-permits-in { display: flex; align-items: center; gap: 6px; }
.pr-permits-in input[type=range] { flex: 1 1 0; min-width: 0; width: 0; min-height: 36px; margin: 0; accent-color: var(--pr-accent); cursor: pointer; }
.pr-step { flex: none; min-width: 52px; min-height: 40px; padding: 0 6px; border: 2px solid var(--pr-line); border-radius: 9px; background: var(--pr-card); color: var(--pr-ink); font-weight: 800; cursor: pointer; }
.pr-step:disabled { opacity: .5; cursor: default; }
.pr-l { font-weight: 700; font-size: 16px; line-height: 1.2; padding: 0; }
.pr-run { flex: none; min-height: 46px; padding: 6px 14px; border: 0; border-radius: 10px; cursor: pointer; font-weight: 800 !important;
  background: linear-gradient(#4a7d50, #2f5d36); color: #fff; box-shadow: 0 3px 0 #1f3d24, 0 4px 8px rgba(0,0,0,.2); }
.pr-run:active:not(:disabled) { transform: translateY(2px); box-shadow: 0 1px 0 #1f3d24; }
.pr-run:disabled { background: #8a9a8d; box-shadow: none; cursor: default; }
.pr-pips { display: flex; gap: 4px; }
.pr-pip { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; border: 2px solid var(--pr-line); font-weight: 800; font-size: 16px; color: var(--pr-future); background: var(--pr-card); }
.pr-pip.is-on { background: var(--pr-accent); border-color: var(--pr-accent); color: var(--pr-accent-ink); }

/* tiles (radio groups) */
.pr-tiles { border: 0; margin: 0; padding: 0; min-width: 0; display: grid; gap: 3px; }
.pr-tiles-g { display: grid; grid-auto-columns: minmax(0, 1fr); grid-auto-flow: column; gap: 6px; }
.pr-tiles.is-list .pr-tiles-g { grid-auto-flow: row; grid-template-columns: 1fr; gap: 4px; }
.pr-tile { position: relative; display: block; min-width: 0; cursor: pointer; }
.pr-tile input { position: absolute; inset: 0; z-index: 1; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; font-size: 16px; }
.pr-tile-b { pointer-events: none; display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 44px; padding: 2px 4px;
  border: 2px solid var(--pr-line); border-radius: 9px; background: var(--pr-card); color: var(--pr-ink); line-height: 1.15; text-align: center; }
.pr-tile-b small { font-size: 16px; opacity: .85; font-variant-numeric: tabular-nums; }
.pr-tiles.is-list .pr-tile-b { flex-direction: row; justify-content: flex-start; text-align: left; min-height: 40px; padding: 3px 8px 3px 6px; gap: 6px; }
.pr-tile.is-on .pr-tile-b { border-color: var(--pr-accent); background: var(--pr-accent); color: var(--pr-accent-ink); box-shadow: 0 2px 6px rgba(40,80,48,.35); }
.pr-tiles.is-list .pr-tile-b::before { flex: none; content: '○'; font-size: 16px; opacity: .65; }
.pr-tiles.is-list .pr-tile.is-on .pr-tile-b::before { content: '●'; opacity: 1; }
.pr-tile input:focus-visible + .pr-tile-b { outline: 3px solid #b77a00; outline-offset: 2px; }
.pr-tile input:disabled { cursor: default; }
.pr-tile input:disabled + .pr-tile-b { opacity: .62; }
.pr-tile.is-on input:disabled + .pr-tile-b { opacity: .88; }

/* panel */
.pr-panel { display: flex; flex-direction: column; gap: 4px; min-height: 0; overflow: auto; padding: 8px 10px;
  background: linear-gradient(var(--pr-panel1), var(--pr-panel2)); border: 3px solid var(--pr-accent); border-radius: 14px; box-shadow: 0 3px 8px rgba(0,0,0,.16); }
.pr-kicker, .pr-k2 { font-size: 16px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; color: var(--pr-accent); }
.pr-ticket { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 1px 8px; margin: 0; padding: 4px 8px; line-height: 1.22;
  background: var(--pr-card); border: 2px dashed var(--pr-line); border-radius: 10px; }
.pr-ticket dt { font-weight: 800; }
.pr-ticket dd { margin: 0; font-variant-numeric: tabular-nums; }
.pr-lock { font-size: 16px; font-style: italic; color: var(--pr-lock); }
.pr-reports { display: grid; gap: 6px; }
.pr-row1 { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; align-items: end; }
.is-ap.is-manage .pr-row1 { grid-template-columns: minmax(0, 1fr) 134px; }
.pr-num { display: grid; gap: 2px; align-content: end; min-width: 0; }
.pr-num-in { display: flex; align-items: center; gap: 6px; }
.pr-num-in input { flex: 1 1 0; width: 0; min-width: 120px; min-height: 44px; padding: 4px 8px; border: 2px solid var(--pr-line); border-radius: 8px;
  background: var(--pr-card); color: var(--pr-ink); font-variant-numeric: tabular-nums; }
.pr-num-in input:disabled { opacity: .7; }
.pr-unit { font-weight: 700; white-space: nowrap; }
.pr :focus-visible { outline: 3px solid #b77a00; outline-offset: 2px; }
/* the verdict is drawn as the herd-monitor stamp; this line is for screen readers only (no layout shift in the panel) */
.pr-verdict { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.pr-about { flex: none; }
.pr-about summary { font-weight: 700; cursor: pointer; }
.pr-about p { margin-top: 4px; font-size: 16px; }
.is-assess .pr-verdict { display: none; }

/* Briefing example */
.pr-ex { display: block; width: 100%; max-width: 460px; height: auto; }
.pr-ex text { font-family: var(--tlg-font, system-ui, sans-serif); }

/* narrower screens: one column, the page scrolls; the scene and ledger scroll sideways (focusable) */
@media (max-width: 900px) {
  .pr { position: static; display: flex; flex-direction: column; height: 100%; overflow: auto; }
  .pr-panel { overflow: visible; flex: none; }
  .pr-left { flex: none; }
}
@media (max-width: 560px) {
  .pr { padding: 6px; }
  .pr-bench { grid-template-columns: 1fr; grid-template-areas: "permits" "habitat" "run"; }
  .pr-runrow { flex-wrap: wrap; }
  .pr-modelnote { flex-basis: 100%; }
  .pr-scene { flex-direction: column; }
  .pr-svg--land, .pr-svg--chart { flex: none; width: 100%; }
  .is-ap.is-manage .pr-row1 { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) { .pr * { animation: none !important; transition: none !important; } }
