/* Selection Forecaster: an evolution field desk. Plot art drawn by art.js (colors from the --sf-* properties below). */
html {
  --sf-sand1: #f4e7c4; --sf-sand2: #dcc690; --sf-ripple: rgba(150, 118, 60, .28); --sf-grain: rgba(120, 92, 50, .35); --sf-tuft: #8a9a4a;
  --sf-lava1: #4a423e; --sf-lava2: #26211f; --sf-crack: rgba(180, 160, 150, .28); --sf-pumice: rgba(20, 16, 14, .55); --sf-edge: rgba(70, 55, 40, .45);
  --sf-litter1: #ab7d4b; --sf-litter2: #7f5a33; --sf-leaf0: #9a6a3a; --sf-leaf1: #b98a52; --sf-leaf2: #865a30; --sf-vein: rgba(60, 38, 18, .45);
  --sf-sky1: #dfeef4; --sf-sky2: #c4dde8;
  --sf-b0a: #fff6dc; --sf-b0b: #d8c18a; --sf-b1a: #c48d52; --sf-b1b: #7e5228; --sf-b2a: #5a4a40; --sf-b2b: #1c1512;
  --sf-legs: #2a201a; --sf-head: #2a201a; --sf-gloss: rgba(255, 255, 255, .5);
  --sf-bird1: #9aa3a8; --sf-bird2: #5f686e; --sf-belly: #f1efe8; --sf-mask: #111; --sf-beak: #2a2a2a; --sf-branch: #6b4a2e;
  --sf-accent: #21576b; --sf-panel1: #f5f9fa; --sf-panel2: #e5eef1; --sf-line: #21576b; --sf-ink: #1b2a30; --sf-ok: #13704a; --sf-bad: #b3261e;
  --sf-start: #5d6f78; --sf-field: #b3261e; --sf-board: #fbfdfd; --sf-grid: rgba(33, 87, 107, .22); --sf-opt-line: #9fb3b9;
}
html[data-theme="dark"] {
  --sf-sand1: #b8a678; --sf-sand2: #8f7c55; --sf-ripple: rgba(60, 45, 20, .35); --sf-grain: rgba(50, 38, 20, .45); --sf-tuft: #b7c06a;
  --sf-lava1: #3a3330; --sf-lava2: #191514; --sf-crack: rgba(180, 160, 150, .22); --sf-pumice: rgba(0, 0, 0, .55); --sf-edge: rgba(20, 15, 10, .55);
  --sf-litter1: #84603a; --sf-litter2: #5c3f22; --sf-leaf0: #77512b; --sf-leaf1: #93693e; --sf-leaf2: #684522; --sf-vein: rgba(30, 18, 8, .5);
  --sf-sky1: #1e3440; --sf-sky2: #142630;
  --sf-b0a: #fff6dc; --sf-b0b: #d8c18a; --sf-b1a: #c48d52; --sf-b1b: #7e5228; --sf-b2a: #5a4a40; --sf-b2b: #1c1512;
  --sf-accent: #7fc6dc; --sf-panel1: #1d2a2f; --sf-panel2: #172226; --sf-line: #5fa9c0; --sf-ink: #e6f0f3; --sf-ok: #4fd08c; --sf-bad: #ff8a80;
  --sf-start: #a9bac2; --sf-field: #ff8a80; --sf-board: #18232a; --sf-grid: rgba(127, 198, 220, .2); --sf-opt-line: #4f6a73;
}

/* ── layout ── */
.sf { position: absolute; inset: 0; display: grid; grid-template-columns: 340px minmax(0, 1fr); gap: 12px; padding: 10px;
  color: var(--tlg-text); font-size: 16px; }
.sf input, .sf button { font: inherit; }
.sf-controls { display: flex; flex-direction: column; gap: 6px; min-height: 0; overflow: auto; padding: 8px 12px;
  background: linear-gradient(var(--sf-panel1), var(--sf-panel2)); border: 3px solid var(--sf-line); border-radius: 14px;
  box-shadow: 0 3px 8px rgba(0,0,0,.16); }
.sf-right { display: flex; flex-direction: column; gap: 8px; min-width: 0; min-height: 0; }
.sf-kicker { margin: 0; font-size: 16px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; color: var(--sf-accent); }
.sf-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.sf-note { margin: 0; font-size: 16px; line-height: 1.25; opacity: .88; }
.sf-step { display: grid; gap: 4px; }
.sf-step-h { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 8px; margin: 0; font-size: 17px; line-height: 1.2; }
.sf-n { flex: none; display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--sf-accent);
  color: #fff; font-size: 16px; font-weight: 800; }
html[data-theme="dark"] .sf-n { color: #0f1d22; }
.sf-step.is-done .sf-n { background: var(--sf-ok); }
.sf-mark { font-weight: 800; font-size: 16px; white-space: nowrap; }
.sf-mark.is-ok { color: var(--sf-ok); } .sf-mark.is-bad { color: var(--sf-bad); }

/* field report (a small clipboard table) */
.sf-report { display: grid; gap: 2px; padding: 6px 10px; border-radius: 10px; background: var(--sf-board); border: 2px dashed var(--sf-opt-line); }
.sf-rep-row { display: grid; grid-template-columns: minmax(0, 1.5fr) repeat(3, minmax(0, 1fr)); align-items: baseline; gap: 4px; font-size: 16px; line-height: 1.3; }
.sf-rep-row b { text-align: center; font-variant-numeric: tabular-nums; font-size: 17px; }
.sf-rep-head b { font-size: 16px; font-weight: 700; opacity: .8; }

/* selection-pattern cards and the "why" list (radio inputs) */
.sf-seg { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 5px; margin: 0; padding: 0; border: 0; min-width: 0; }
.sf-opt { position: relative; display: grid; justify-items: center; align-content: center; gap: 1px; min-height: 66px; padding: 3px 2px; text-align: center;
  border: 2px solid var(--sf-opt-line); border-radius: 10px; background: #fff; color: #1b2a30; cursor: pointer; line-height: 1.1; }
.sf-opt b { font-size: 16px; }
.sf-opt small { font-size: 16px; opacity: .85; }
.sf-opt-i svg { width: 46px; height: 24px; display: block; }
.sf-pi-axis { stroke: currentColor; stroke-width: 2; opacity: .6; }
.sf-pi-bar { fill: var(--sf-accent); opacity: .85; }
.sf-list { display: grid; gap: 4px; margin: 0; padding: 0; border: 0; min-width: 0; }
.sf-list--2 { grid-template-columns: 1fr 1fr; }
.sf-list--2 .sf-li { min-height: 36px; padding: 2px 8px; line-height: 1.2; }
.sf-list--2 .sf-dot { display: none; }
.sf-li { position: relative; display: flex; align-items: center; gap: 8px; min-height: 40px; padding: 3px 10px; border: 2px solid var(--sf-opt-line);
  border-radius: 10px; background: #fff; color: #1b2a30; cursor: pointer; line-height: 1.15; font-size: 16px; }
.sf-dot { flex: none; width: 16px; height: 16px; border-radius: 50%; border: 2px solid currentColor; }
.sf-opt input, .sf-li input { position: absolute; z-index: 2; opacity: 0; inset: 0; margin: 0; cursor: pointer; width: 100%; height: 100%; }
.sf-opt:has(input:checked), .sf-li:has(input:checked) { border-color: var(--sf-accent); background: var(--sf-accent); color: #fff; box-shadow: inset 0 0 0 2px #fff; }
.sf-opt:has(input:checked) .sf-pi-bar { fill: #fff; }
.sf-li:has(input:checked) .sf-dot { background: currentColor; box-shadow: inset 0 0 0 3px var(--sf-accent); }
html[data-theme="dark"] .sf-opt, html[data-theme="dark"] .sf-li { background: #22323a; color: #e6f0f3; }
html[data-theme="dark"] .sf-opt:has(input:checked), html[data-theme="dark"] .sf-li:has(input:checked) { background: var(--sf-accent); border-color: var(--sf-accent); color: #0f1d22; box-shadow: inset 0 0 0 2px #0f1d22; }
html[data-theme="dark"] .sf-li:has(input:checked) .sf-dot { box-shadow: inset 0 0 0 3px var(--sf-accent); }
html[data-theme="dark"] .sf-opt:has(input:checked) .sf-pi-bar { fill: #0f1d22; }
.sf-opt:has(input:focus-visible), .sf-li:has(input:focus-visible) { outline: 3px solid var(--tlg-focus, #1a73e8); outline-offset: 2px; }
.sf-opt:hover:not(:has(input:disabled)), .sf-li:hover:not(:has(input:disabled)) { border-color: var(--sf-accent); }
.sf-opt:has(input:disabled), .sf-li:has(input:disabled) { cursor: default; }
.sf-opt:has(input:disabled):not(:has(input:checked)), .sf-li:has(input:disabled):not(:has(input:checked)) { opacity: .6; }

/* mean input */
.sf-num { display: grid; grid-template-columns: minmax(0, 1fr) 92px; align-items: center; gap: 6px; }
.sf-num-f { font-size: 16px; line-height: 1.2; }
.sf-num input { width: 100%; min-width: 0; font-size: 17px; min-height: 42px; padding: 4px 8px; border: 2px solid var(--sf-opt-line); border-radius: 8px;
  background: #fff; color: #1f2a30; }
html[data-theme="dark"] .sf-num input { background: #10191d; color: #eef4f6; }
.sf-num input:focus-visible { outline: 3px solid var(--tlg-focus, #1a73e8); outline-offset: 2px; }
.sf-num input:disabled { opacity: 1; }

.sf-about { padding: 4px 8px; border: 1px solid var(--tlg-border, #ccd); border-radius: 8px; font-size: 16px; }
.sf-about summary { cursor: pointer; min-height: 30px; font-weight: 700; }
.sf-about p { margin: 6px 0; line-height: 1.3; }

/* ── field plot ── */
.sf-plot { position: relative; flex: 0 0 auto; height: 196px; border-radius: 12px; overflow: hidden; box-shadow: 0 3px 8px rgba(0,0,0,.2); background: var(--sf-lava2); }
.sf-plot-svg { display: block; width: 100%; height: 100%; }
.sf-plot-frame { fill: none; stroke: var(--sf-line); stroke-width: 3; }
.sf-ripple { stroke: var(--sf-ripple); stroke-width: 1.5; }
.sf-grain { fill: var(--sf-grain); } .sf-pumice { fill: var(--sf-pumice); }
.sf-crack { fill: none; stroke: var(--sf-crack); stroke-width: 1.4; stroke-linejoin: round; }
.sf-edge { fill: none; stroke: var(--sf-edge); stroke-width: 3; }
.sf-tuft { fill: none; stroke: var(--sf-tuft); stroke-width: 2; stroke-linecap: round; }
.sf-leaf--0 { fill: var(--sf-leaf0); } .sf-leaf--1 { fill: var(--sf-leaf1); } .sf-leaf--2 { fill: var(--sf-leaf2); }
.sf-vein { stroke: var(--sf-vein); stroke-width: 1; }
.sf-legs { fill: none; stroke: var(--sf-legs); stroke-width: 1.4; stroke-linecap: round; }
.sf-head { fill: var(--sf-head); }
.sf-thorax--0 { fill: #b9a170; } .sf-thorax--1 { fill: #6a4320; } .sf-thorax--2 { fill: #15100d; }
.sf-shell { stroke: rgba(0,0,0,.4); stroke-width: .8; }
.sf-seam { stroke: rgba(0,0,0,.45); stroke-width: .9; }
.sf-gloss { fill: var(--sf-gloss); }
.sf-beetle { transition: opacity .35s ease; }
.sf-beetle.is-taken { opacity: 0; }
.sf-branch { fill: none; stroke: var(--sf-branch); stroke-width: 6; stroke-linecap: round; }
.sf-twig { fill: none; stroke: var(--sf-branch); stroke-width: 3; stroke-linecap: round; }
.sf-bird-tail { fill: var(--sf-mask); } .sf-bird-wing { fill: #2f3437; } .sf-bird-belly { fill: var(--sf-belly); }
.sf-bird-mask { stroke: var(--sf-mask); stroke-width: 4; stroke-linecap: round; } .sf-bird-eye { fill: #fff; }
.sf-bird-beak { fill: var(--sf-beak); } .sf-bird-leg { stroke: #333; stroke-width: 2; }
.sf-puff circle { fill: none; stroke: #fff; stroke-width: 2.5; animation: sf-puff .6s ease-out forwards; }
.sf-puff path { stroke: #ffd36a; stroke-width: 2.5; stroke-linecap: round; animation: sf-puff .6s ease-out forwards; }
@keyframes sf-puff { from { opacity: 1; transform: scale(.4); } to { opacity: 0; transform: scale(1.5); } }
.sf-plot-tag { position: absolute; left: 10px; top: 8px; display: grid; padding: 3px 10px; border-radius: 8px; background: rgba(255,255,255,.92);
  color: #1b2a30; font-size: 16px; line-height: 1.25; box-shadow: 0 1px 4px rgba(0,0,0,.25); }
html[data-theme="dark"] .sf-plot-tag { background: rgba(16,26,30,.9); color: #e6f0f3; }
.sf-plot-tag span { font-size: 16px; opacity: .85; }
.sf-stamp { position: absolute; right: 18px; bottom: 14px; padding: 6px 14px; border: 3px solid var(--sf-ok); border-radius: 10px;
  background: rgba(255,255,255,.93); color: var(--sf-ok); font-size: 20px; font-weight: 800; letter-spacing: .03em; text-transform: uppercase;
  transform: rotate(-4deg); animation: sf-stamp .45s cubic-bezier(.2,1.6,.4,1); }
html[data-theme="dark"] .sf-stamp { background: rgba(16,26,30,.93); }
@keyframes sf-stamp { from { transform: rotate(-4deg) scale(1.8); opacity: 0; } to { transform: rotate(-4deg) scale(1); opacity: 1; } }

/* ── distribution board ── */
.sf-board { --sf-ax: 34px; flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; gap: 4px; padding: 6px 12px 6px 8px;
  border-radius: 12px; background: var(--sf-board); border: 2px solid var(--sf-line); box-shadow: 0 3px 8px rgba(0,0,0,.12); }
.sf-board-h { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 16px; font-size: 16px; padding-left: var(--sf-ax); }
.sf-board-h > b { font-size: 17px; margin-right: auto; }
.sf-key { display: inline-flex; align-items: center; gap: 6px; }
.sf-key i { display: inline-block; width: 18px; height: 14px; border-radius: 2px; }
.sf-key-start { border: 2px dashed var(--sf-start); }
.sf-key-fc { background: linear-gradient(90deg, var(--sf-b0b), var(--sf-b1a), var(--sf-b2a)); border: 1px solid rgba(0,0,0,.4); }
.sf-key-field { height: 4px !important; background: var(--sf-field); }
.sf-chart { position: relative; flex: 1 1 auto; min-height: 110px; display: grid; grid-template-columns: var(--sf-ax) minmax(0, 1fr); }
.sf-yaxis { display: flex; flex-direction: column; justify-content: space-between; align-items: flex-end; padding-right: 6px; font-size: 16px; line-height: 1;
  margin: -8px 0; opacity: .8; }
.sf-cols { position: relative; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-left: 2px solid currentColor; border-bottom: 2px solid currentColor; }
.sf-line { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; z-index: 2; }
.sf-grid { stroke: var(--sf-grid); stroke-width: 1; vector-effect: non-scaling-stroke; stroke-dasharray: 4 4; }
.sf-join { fill: none; stroke: var(--sf-accent); stroke-width: 2.5; stroke-dasharray: 7 6; vector-effect: non-scaling-stroke; }
.sf-join--field { stroke: var(--sf-field); stroke-dasharray: 2 5; stroke-linecap: round; }
.sf-col-bars { position: relative; height: 100%; }
.sf-bar { position: absolute; bottom: 0; left: 50%; border-radius: 4px 4px 0 0; transition: height .35s cubic-bezier(.3,1.2,.5,1); }
.sf-bar--start { width: 64%; transform: translateX(-50%); border: 2px dashed var(--sf-start); border-bottom: 0; background: repeating-linear-gradient(135deg, transparent 0 6px, var(--sf-grid) 6px 8px); }
.sf-bar--fc { width: 34%; transform: translateX(-50%); border: 1px solid rgba(0,0,0,.45); border-bottom: 0; box-shadow: inset -6px 0 8px rgba(0,0,0,.18), inset 4px 0 6px rgba(255,255,255,.35); }
.sf-bar--0 { background: linear-gradient(90deg, var(--sf-b0a), var(--sf-b0b)); }
.sf-bar--1 { background: linear-gradient(90deg, var(--sf-b1a), var(--sf-b1b)); }
.sf-bar--2 { background: linear-gradient(90deg, var(--sf-b2a), var(--sf-b2b)); }
.sf-val { position: absolute; left: 50%; transform: translateX(-50%); font-size: 16px; font-weight: 800; font-variant-numeric: tabular-nums;
  padding: 0 4px; border-radius: 4px; background: var(--sf-board); white-space: nowrap; z-index: 3; transition: bottom .35s cubic-bezier(.3,1.2,.5,1); }
.sf-fieldmark { position: absolute; left: 12%; right: 12%; height: 0; border-top: 4px solid var(--sf-field); z-index: 3; animation: sf-drop .5s ease-out; }
@keyframes sf-drop { from { opacity: 0; transform: translateY(-14px); } to { opacity: 1; transform: none; } }
.is-revealed .sf-val { opacity: .9; }

.sf-mean { position: relative; height: 26px; margin-left: var(--sf-ax); }
.sf-mean-line { position: absolute; left: 16.667%; right: 16.667%; top: 4px; border-top: 2px solid var(--sf-grid); }
.sf-mpin { position: absolute; top: 0; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; font-size: 16px; line-height: 1; white-space: nowrap; }
.sf-mpin i { width: 0; height: 0; border-left: 7px solid transparent; border-right: 7px solid transparent; border-bottom: 10px solid var(--sf-start); }
.sf-mpin span { margin-top: 2px; }
.sf-mpin--start { color: var(--sf-start); }
.sf-mpin--field { color: var(--sf-field); font-weight: 800; z-index: 2; }
.sf-mpin--field i { border-bottom-color: var(--sf-field); }
.is-revealed .sf-mpin--start span { opacity: 0; }

.sf-foot { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-left: var(--sf-ax); }
.sf-bin { display: grid; gap: 2px; min-width: 0; }
.sf-bin-l { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.sf-sw svg { width: 22px; height: 28px; display: block; }
.sf-bin-t { display: grid; line-height: 1.05; }
.sf-bin-t b { font-size: 16px; } .sf-bin-t small { font-size: 16px; opacity: .85; }
.sf-nums { margin: 0; display: flex; flex-wrap: wrap; gap: 0 8px; font-size: 16px; font-variant-numeric: tabular-nums; line-height: 1.2; }
.sf-nums span { opacity: .8; }
.sf-nums em { font-style: normal; font-weight: 800; color: var(--sf-field); }
.sf-nums.is-zero b { color: var(--sf-bad); }
.sf-dial { display: grid; gap: 0; }
.sf-dial-h { display: flex; justify-content: space-between; gap: 6px; font-size: 16px; font-weight: 700; }
.sf-dial-v { font-weight: 800; color: var(--sf-accent); white-space: nowrap; }
.sf-dial input { width: 100%; min-height: 28px; margin: 0; accent-color: var(--sf-accent); cursor: pointer; }
.sf-dial input:focus-visible { outline: 3px solid var(--tlg-focus, #1a73e8); outline-offset: 2px; }
.sf-dial input:disabled { cursor: default; }
.sf-ticks { display: flex; justify-content: space-between; font-size: 16px; line-height: 1; opacity: .8; padding: 0 3px; margin-top: -3px; }
.sf-cap { margin: 0; padding-left: var(--sf-ax); font-size: 16px; line-height: 1.2; opacity: .85; }

/* Briefing worked example */
.sf-ex-svg { display: block; width: 100%; height: auto; }
.sf-ex-svg text { font-family: var(--tlg-font, system-ui); fill: currentColor; }
.sf-ex-t { font-size: 16px; } .sf-ex-b { font-weight: 800; } .sf-ex-w { opacity: .85; }
.sf-ex-axis { fill: none; stroke: currentColor; stroke-width: 2; }
.sf-ex-start { fill: none; stroke: var(--sf-start); stroke-width: 2; stroke-dasharray: 5 4; }
.sf-ex-surv { stroke: rgba(0,0,0,.45); stroke-width: 1; }
.sf-ex-line { fill: none; stroke: var(--sf-accent); stroke-width: 2.5; stroke-dasharray: 7 6; }
.sf-ex-mean { fill: var(--sf-field); }
.sf-ex-smean { fill: none; stroke: var(--sf-start); stroke-width: 2; }
.sf-ex-track { stroke: currentColor; stroke-width: 2; opacity: .35; }
.sf-ex-shift { fill: none; stroke: var(--sf-field); stroke-width: 2.5; marker-end: none; stroke-dasharray: 4 4; }

/* Start-screen art */
.sf-card { fill: #fff; stroke: #21576b; stroke-width: 3; }
.sf-sa-bar { stroke: rgba(0,0,0,.4); } .sf-sa-bar--0 { fill: #e8d6a4; } .sf-sa-bar--1 { fill: #a87440; } .sf-sa-bar--2 { fill: #3a2e27; }
.sf-sa-line { fill: none; stroke: #21576b; stroke-width: 2.5; stroke-dasharray: 5 4; }
.sf-sa-ring { fill: none; stroke: #21576b; stroke-width: 6; }

/* the 3-row field report gets tight on a 1366×768 Chromebook: keep the board's text at 16 px and trim gaps */
@media (max-height: 800px) and (min-width: 901px) {
  .sf-controls { gap: 5px; }
}
@media (max-width: 900px) {
  .sf { position: static; grid-template-columns: 1fr; }
  .sf-right { order: -1; }
  .sf-controls { overflow: visible; }
  .sf-chart { min-height: 160px; flex: none; height: 170px; }
  .sf-board { --sf-ax: 30px; }
}
@media (max-width: 520px) {
  .sf-foot { grid-template-columns: 1fr; }
  .sf-plot { height: 170px; }
  .sf-nums { gap: 0 6px; }
}
@media (prefers-reduced-motion: reduce) {
  .sf *, .sf *::before, .sf *::after { animation: none !important; transition: none !important; }
}
.sf-fieldmark { margin-bottom: -2px; }
