/* Shared styles for explorable figures: cards, one look per kind of control, the figure key, popovers.
   Owned by the explorable-figures skill (began as an extract of learn-agent-prototype's lib/explorable.css; the two may differ). The palette below is a subset. */
:root {
  /* NVIDIA palette: green is the hero accent; other colors only tell quantities apart. *-ink variants darken a color used as text. */
  --bg: #f7f7f7; --panel: #ffffff; --fg: #000000; --muted: #757575; --grid: #ebebeb; --line: #d6d6d6; --bad: #e52020; --hl: #eef6da;
  --accent: #76b900; --accent-ink: #3f8500;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #000000; --panel: #1a1a1a; --fg: #ffffff; --muted: #a3a3a3; --grid: #2a2a2a; --line: #3a3a3a; --bad: #ff5a5a; --hl: #26360a;
    --accent: #76b900; --accent-ink: #76b900;
  }
}
:root[data-theme="dark"] {
  --bg: #000000; --panel: #1a1a1a; --fg: #ffffff; --muted: #a3a3a3; --grid: #2a2a2a; --line: #3a3a3a; --bad: #ff5a5a; --hl: #26360a;
  --accent: #76b900; --accent-ink: #76b900;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--fg); font: 16px/1.6 "NVIDIA Sans", system-ui, -apple-system, "Segoe UI", sans-serif; }
main { max-width: 860px; margin: 0 auto; padding: 32px 16px 80px; }
h1 { font-size: 2rem; line-height: 1.2; margin: 0 0 8px; }
h2 { font-size: 1.35rem; margin: 48px 0 4px; }
h3 { font-size: 1.1rem; margin: 0 0 2px; }
a { color: var(--accent-ink); }
.lede { color: var(--muted); }
code, pre { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 0.88em; }
.note { border-left: 3px solid var(--line); padding: 4px 12px; color: var(--muted); font-size: 0.9em; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 20px; margin: 20px 0; scroll-margin-top: 16px; }
.card .when { color: var(--muted); margin: 0 0 14px; font-size: 0.92em; }
.card > h2:first-child { margin-top: 0; }
/* What to try first: one line that gives the reader a goal, not only a list of controls. */
.try { border-left: 3px solid var(--accent); padding: 2px 12px; margin: 10px 0; }
canvas { display: block; width: 100%; }
canvas.drag { touch-action: none; } canvas.drag-x, .seek { touch-action: pan-y; } canvas.drag-x { cursor: ew-resize; }
.row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 8px 0; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid2 > * { min-width: 0; }
@media (max-width: 640px) { .grid2 { grid-template-columns: 1fr; } }
button { font: inherit; font-size: 0.9em; padding: 4px 12px; border-radius: 8px; border: 1px solid var(--line); background: var(--bg); color: var(--fg); cursor: pointer; }
button:hover:not(:disabled) { border-color: var(--muted); }
button:disabled { opacity: 0.45; cursor: default; }
button.primary { background: var(--accent); border-color: var(--accent); color: #000; }
button.choice[aria-pressed="true"] { border-color: var(--accent); outline: 2px solid var(--accent); }
input[type=range] { flex: 1; min-width: 120px; accent-color: var(--accent); }
.readout { font-variant-numeric: tabular-nums; color: var(--muted); font-size: 0.9em; }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; border: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.hint { color: var(--muted); font-size: 0.85em; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.scrub { touch-action: pan-y; cursor: ew-resize; border-bottom: 1.5px dashed currentColor; font-weight: 600; font-variant-numeric: tabular-nums; user-select: none; -webkit-user-select: none; padding: 0 1px; border-radius: 3px; }
.scrub:hover, .scrub.active { background: var(--hl); }
.scrub.gauge { position: relative; border-bottom-color: color-mix(in srgb, currentColor 35%, transparent); }
.scrub.gauge::after { content: ""; position: absolute; left: 0; bottom: -1.5px; height: 2px; width: calc(var(--f, 0) * 100%); background: currentColor; border-radius: 1px; }
.scrub.bump { animation: scrub-bump .28s; background: var(--hl); }
@keyframes scrub-bump { 25% { left: -3px; } 75% { left: 3px; } }
#scrub-bub { position: absolute; z-index: 20; transform: translate(-50%, -100%); pointer-events: none; font-size: 0.75em; white-space: nowrap; background: var(--fg); color: var(--bg); border-radius: 6px; padding: 1px 6px; font-variant-numeric: tabular-nums; }
@media (prefers-reduced-motion: reduce) { .scrub.bump { animation: none; outline: 1.5px solid var(--bad); } }
button.statelink { border: none; padding: 0 4px; border-radius: 4px; background: color-mix(in srgb, var(--accent) 14%, transparent); color: var(--accent-ink); font-size: 1em; }
button.statelink:hover { background: color-mix(in srgb, var(--accent) 26%, transparent); }
button.term { border: none; background: none; padding: 0; font-size: 1em; color: inherit; border-bottom: 1px dotted var(--muted); border-radius: 0; cursor: help; }
#pop, #keytip { position: absolute; z-index: 10; max-width: 330px; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; box-shadow: 0 8px 24px rgba(0,0,0,.15); font-size: 0.9em; display: none; }
#keytip { z-index: 11; max-width: 300px; font-size: 0.85em; }
#keytip .k-count { margin-top: 4px; color: var(--muted); }
#pop .math { font-family: ui-monospace, Menlo, monospace; font-size: 0.9em; margin-top: 4px; color: var(--muted); }
.pick { cursor: pointer; box-shadow: 0 2px 0 var(--line); }
canvas.seek { cursor: ew-resize; border-bottom: 1.5px dashed color-mix(in srgb, var(--muted) 70%, transparent); }
.figkey { display: flex; flex-wrap: wrap; gap: 4px 18px; font-size: 0.82em; margin: 2px 0 10px; line-height: 1.6; }
.figkey[hidden], .figkey .k-item[hidden] { display: none; }
.figkey .k-item { white-space: nowrap; cursor: help; border-radius: 6px; padding: 0 4px; margin: 0 -4px; } .figkey .k-how { color: var(--muted); }
.figkey .k-item:hover, .figkey .k-item.on { background: var(--hl); }
.k-lit { outline: 2px solid var(--accent); outline-offset: 3px; animation: k-lit 1.1s ease-in-out infinite alternate; }
svg .k-lit { outline: none; filter: drop-shadow(0 0 2px var(--accent)) drop-shadow(0 0 2px var(--accent)); }
@keyframes k-lit { to { outline-color: color-mix(in srgb, var(--accent) 35%, transparent); } }
@media (prefers-reduced-motion: reduce) { .k-lit { animation: none; } }
.k-scrub { border-bottom: 1.5px dashed currentColor; font-weight: 600; color: var(--fg); }
.k-define { border-bottom: 1px dotted var(--muted); color: var(--fg); }
.k-act { padding: 0 4px; border-radius: 4px; background: color-mix(in srgb, var(--accent) 14%, transparent); color: var(--accent-ink); }
.k-select { padding: 0 5px; border: 1px solid var(--line); border-radius: 5px; box-shadow: 0 2px 0 var(--line); color: var(--fg); background: var(--panel); }
.k-seek { padding: 0 4px; border-bottom: 1.5px dashed var(--muted); color: var(--fg); }
.k-drag { padding: 0 5px; border: 1.5px solid var(--accent); border-radius: 999px; color: var(--fg); }
.k-key { font-family: ui-monospace, Menlo, monospace; font-size: 0.92em; padding: 0 4px; border-radius: 4px; background: var(--grid); color: var(--fg); }
ul.checks { list-style: none; padding: 0; margin: 12px 0 0; font-size: 0.92em; }
ul.checks li { margin: 4px 0; }
ul.checks li > span:first-child { display: inline-block; width: 1.3em; font-weight: 700; }
ul.checks li.pass > span:first-child { color: var(--accent-ink); } ul.checks li.fail > span:first-child { color: var(--bad); }
footer { margin-top: 48px; color: var(--muted); font-size: 0.88em; }
.box { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 14px 18px; margin: 16px 0; }
.box h3 { margin-bottom: 6px; }
.box ul { margin: 4px 0; padding-left: 1.2em; }
.try { border-left: 3px solid var(--accent); background: var(--hl); padding: 8px 12px; border-radius: 0 8px 8px 0; font-size: 0.93em; margin: 12px 0 0; }
.try b:first-child { color: var(--accent-ink); }
.callout { border-left: 3px solid var(--accent); background: var(--hl); padding: 8px 12px; border-radius: 0 8px 8px 0; }
