/* OD-LAYOUT-PRIMITIVES v1 — structure only: display, flex/grid, overflow, wrapping, ratio, geometry.
   Put this @layer first; product CSS outside the layer wins ordinary layout rules.
   Native hidden and closed-dialog states take precedence over component display rules. */
@layer od-layout {
  [hidden]:not([hidden="until-found" i]) { display: none !important; }
  dialog:not([open]) { display: none !important; }

  :where(.od-stack,.od-row,.od-row-top,.od-cluster,.od-grid,.od-field,.od-stat,.od-cell,.od-tile) > :where(*) { min-width: 0; }

  /* containers */
  .od-stack   { display: flex; flex-direction: column; gap: var(--od-gap, 8px); }
  .od-row     { display: flex; align-items: center; gap: var(--od-gap, 8px); }
  .od-row-top { display: flex; align-items: flex-start; gap: var(--od-gap, 8px); }
  .od-cluster { display: flex; flex-wrap: wrap; align-items: center; gap: var(--od-gap, 8px); }
  .od-fill    { flex: 1 1 0; min-width: 0; }
  .od-fixed   { flex: none; }
  .od-grid    { display: grid; gap: var(--od-gap, 12px); grid-template-columns: repeat(var(--od-cols, 3), minmax(0, 1fr)); }

  /* stacked information: each piece is its own line — never sibling inline spans */
  .od-stat, .od-field, .od-cell { display: grid; gap: var(--od-gap, 2px); }
  :where(.od-stat,.od-field,.od-cell) > :where(*) { display: block; }
  .od-tile { display: grid; grid-template-rows: auto 1fr; }
  :where(.od-tile) > :where(*) { display: block; }

  .od-media { display: block; width: 100%; height: auto; aspect-ratio: var(--od-ratio, auto); }
  .od-media-cover { object-fit: cover; }

  /* functional inline SVG icons opt into bounded geometry; content SVGs keep their own */
  .od-icon { display: inline-block; inline-size: var(--od-icon-size, 1em); block-size: var(--od-icon-size, 1em); flex: none; }

  /* data text only — authored copy is rewritten to its budget instead */
  .od-truncate { display: block; max-width: 100%; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
  .od-clamp-2, .od-clamp-3 { display: -webkit-box; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
  .od-clamp-2 { -webkit-line-clamp: 2; }
  .od-clamp-3 { -webkit-line-clamp: 3; }
  .od-lines-2 { min-height: calc(2 * 1.4em); }
  .od-nowrap  { white-space: nowrap; }
  .od-keep    { word-break: keep-all; overflow-wrap: anywhere; }

  .od-screen { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; height: 100%; }
  .od-scroll { overflow-y: auto; overscroll-behavior: contain; min-height: 0; }

  .od-rail { display: flex; gap: var(--od-gap, 8px); overflow-x: auto; scroll-snap-type: x proximity; scrollbar-width: none;
             padding-inline: var(--od-rail-pad, 16px); scroll-padding-inline: var(--od-rail-pad, 16px); }
  .od-rail::-webkit-scrollbar { display: none; }
  :where(.od-rail) > :where(*) { flex: none; scroll-snap-align: start; }
  :where(.od-rail) > :where(:last-child) { margin-inline-end: var(--od-rail-pad, 16px); }

  .od-spacer { flex: none; visibility: hidden; pointer-events: none; }
  .od-touch  { min-width: 44px; min-height: 44px; }
}
:root [hidden]:where(:not([hidden="until-found" i])) { display: none; }
/* /OD-LAYOUT-PRIMITIVES v1 */

/* Learning canvas — product styles. All tokens live here. */
:root {
  /* grounds and ink */
  --ground: #ECEEF1;
  --grid-dot: #C9CED5;
  --surface: #FFFFFF;
  --surface-2: #F4F5F7;
  --ink: #14181D;
  --ink-2: #353E48;
  --muted: #56616C;
  --line: #D3D8DE;
  --line-strong: #A9B1BB;

  /* two inks: the agent is teal, the learner is ink + cobalt selection */
  --agent: #0B7A75;
  --agent-ink: #075E5A;
  --agent-tint: #DCF0EE;
  --agent-2: #8A3FA0;
  --you: #2747D4;
  --you-tint: #E3E8FB;

  /* states */
  --ready: #C98A00;
  --ready-ink: #6F4A00;
  --ready-tint: #FFF1CC;
  --bad: #B4341F;
  --bad-tint: #FBE6E1;
  --ok: #1E6B3A;
  --ok-tint: #E2F2E7;

  /* check mode: quiet */
  --quiet-bg: #1B2027;
  --quiet-surface: #252B33;
  --quiet-ink: #E8ECEF;
  --quiet-muted: #AEB7C0;
  --quiet-line: #46505B;

  /* type */
  --font-display: "Bricolage Grotesque", "Avenir Next", "Segoe UI", system-ui, sans-serif;
  --font-body: "IBM Plex Sans", "Segoe UI", system-ui, -apple-system, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --fs-xs: 12px;
  --fs-sm: 13px;
  --fs-md: 14px;
  --fs-body: 16px;
  --fs-lg: 20px;
  --fs-xl: 26px;

  /* spacing (multiples of 4) */
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 20px; --s6: 24px; --s8: 32px;
  --r1: 4px; --r2: 8px; --r3: 12px;

  /* motion */
  --t-fast: 150ms;
  --t-med: 250ms;
  --t-exit: 160ms;
  --ease-out: cubic-bezier(.2, .7, .2, 1);
  --ease-in: cubic-bezier(.6, 0, .9, .4);

  --shadow: 0 1px 2px rgba(20, 24, 29, .08), 0 6px 20px rgba(20, 24, 29, .08);
  --bar-h: 56px;
  --side-w: 296px;
  --drawer-w: 380px;
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  font-family: var(--font-body);
  font-size: var(--fs-body);
  line-height: 1.5;
  color: var(--ink);
  background: var(--ground);
  overflow: hidden;
}
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
p { margin: 0; }
h1, h2, h3 { margin: 0; font-family: var(--font-display); font-weight: 700; line-height: 1.2; }
:focus-visible { outline: 2px solid var(--you); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s2);
  min-height: 36px; padding: 0 var(--s3);
  border: 1px solid transparent; border-radius: var(--r2);
  background: transparent; color: var(--ink);
  font-size: var(--fs-md); font-weight: 500; white-space: nowrap;
  transition: background var(--t-fast) var(--ease-out), border-color var(--t-fast) var(--ease-out);
}
.btn-primary { background: var(--ink); color: #fff; border-color: var(--ink); }
.btn-primary:disabled { background: var(--line); border-color: var(--line); color: var(--muted); cursor: not-allowed; }
.btn-surface { background: var(--surface); border-color: var(--line-strong); color: var(--ink); }
.btn-quiet { background: transparent; border-color: var(--line-strong); color: var(--ink); }
.btn-agent { background: var(--agent); border-color: var(--agent); color: #fff; }
.btn-danger { background: var(--surface); border-color: var(--bad); color: var(--bad); }
.btn-small { min-height: 28px; padding: 0 var(--s2); font-size: var(--fs-sm); }
.btn-toggle { border-color: var(--line-strong); background: var(--surface); }
.btn-toggle .toggle-dot { width: 10px; height: 10px; border-radius: 50%; border: 2px solid var(--muted); display: block; }
.btn-toggle[aria-pressed="true"] { border-color: var(--agent); color: var(--agent-ink); background: var(--agent-tint); }
.btn-toggle[aria-pressed="true"] .toggle-dot { background: var(--agent); border-color: var(--agent); }
.iconbtn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; flex: none;
  border: 1px solid var(--line-strong); border-radius: var(--r2);
  background: var(--surface); color: var(--ink);
  --od-icon-size: 18px;
}
@media (hover: hover) {
  .btn-primary:not(:disabled):hover { background: #000; }
  .btn-surface:hover, .btn-quiet:hover, .iconbtn:hover, .btn-toggle:hover { border-color: var(--ink); }
  .btn-agent:hover { background: var(--agent-ink); }
  .btn-danger:hover { background: var(--bad-tint); }
}
.count {
  display: inline-block; min-width: 20px; padding: 0 6px; border-radius: 10px;
  background: var(--ink); color: #fff; font-size: var(--fs-xs); font-weight: 600; text-align: center; line-height: 20px;
}
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--agent); }

.seg { display: inline-flex; padding: 3px; gap: 2px; background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--r2); }
.seg-btn {
  min-height: 30px; padding: 0 var(--s3); border: 0; border-radius: 6px; background: transparent;
  font-size: var(--fs-md); font-weight: 600; color: var(--ink-2);
}
.seg-btn[aria-pressed="true"] { background: var(--ink); color: #fff; }
.seg-small .seg-btn { min-height: 28px; padding: 0 var(--s2); font-size: var(--fs-sm); }

/* ---------- canvas ---------- */
.canvas {
  position: fixed; inset: 0; overflow: hidden; touch-action: none;
  background-color: var(--ground);
  background-image: radial-gradient(var(--grid-dot) 1px, transparent 1px);
  background-size: 24px 24px;
  cursor: grab; outline-offset: -4px;
}
.canvas.is-panning { cursor: grabbing; }
.canvas.is-lasso { cursor: crosshair; }
.world { position: absolute; left: 0; top: 0; transform-origin: 0 0; }
.edges { position: absolute; left: 0; top: 0; overflow: visible; pointer-events: none; }
.edge { fill: none; stroke: var(--line-strong); stroke-width: 1.5; }
.edge-draft { stroke-dasharray: 2 4; }
.edge-goal { fill: none; stroke: var(--line-strong); stroke-width: 1; stroke-dasharray: 3 5; opacity: .7; }
.edge-hot { stroke: var(--ink); stroke-width: 2; opacity: 1; stroke-dasharray: none; }
.edge-route-a { fill: none; stroke: var(--you); stroke-width: 2.5; }
.edge-route-b { fill: none; stroke: var(--you); stroke-width: 2.5; stroke-dasharray: 8 5; }
.edge-label { font: 600 11px var(--font-body); fill: var(--you); paint-order: stroke; stroke: var(--ground); stroke-width: 4px; }

.lasso { position: absolute; border: 1.5px dashed var(--you); background: rgba(39, 71, 212, .08); pointer-events: none; }
.dropzone {
  position: absolute; inset: 0; display: grid; place-items: center;
  background: rgba(20, 24, 29, .45); pointer-events: none; z-index: 5;
}
.dropzone-card { padding: var(--s6) var(--s8); background: var(--surface); border: 2px dashed var(--ink); border-radius: var(--r3); text-align: center; }
.dropzone-title { font-family: var(--font-display); font-size: var(--fs-lg); font-weight: 700; }
.dropzone-sub { color: var(--muted); font-size: var(--fs-md); }

/* epitome cluster */
.epitome {
  position: absolute; border: 1.5px solid var(--ink); border-radius: var(--r3);
  background: rgba(255, 255, 255, .55);
}
.epitome-label {
  position: absolute; left: 16px; top: 10px;
  font-family: var(--font-display); font-weight: 700; font-size: 15px; letter-spacing: .01em;
}
.epitome-sub { position: absolute; left: 16px; top: 30px; right: 12px; font-size: 11px; color: var(--muted); line-height: 1.35; }
[data-zoom="far"] .epitome-label { font-size: 34px; top: -52px; left: 0; }
[data-zoom="far"] .epitome-sub { display: none; }

/* nodes */
.node { position: absolute; width: 190px; }
.node.goal { width: 230px; }
.node-chip {
  display: flex; align-items: center; gap: var(--s2);
  width: 100%; min-height: 46px; padding: 6px 10px;
  background: var(--surface); border: 1.5px solid var(--line-strong); border-radius: var(--r2);
  color: var(--ink); text-align: left; font-size: 13px; font-weight: 500; line-height: 1.3;
  transition: border-color var(--t-fast) var(--ease-out), box-shadow var(--t-fast) var(--ease-out);
}
.node-glyph { --od-icon-size: 20px; display: flex; }
.node-title { display: block; }
.node-tag {
  position: absolute; right: 6px; top: -9px; padding: 0 6px; border-radius: 8px;
  background: var(--ink); color: #fff; font-size: 10px; font-weight: 600; line-height: 16px; letter-spacing: .03em;
}
.node[data-state="untested"] .node-chip { border-style: dashed; background: var(--surface-2); color: var(--ink-2); }
.node[data-state="notknown"] .node-chip { border-color: var(--bad); }
.node[data-state="notknown"] .node-glyph { color: var(--bad); }
.node[data-state="ready"] .node-chip { border-color: var(--ready); box-shadow: 0 0 0 4px rgba(201, 138, 0, .28), 0 0 18px rgba(201, 138, 0, .45); }
.node[data-state="ready"] .node-glyph { color: var(--ready-ink); }
.node[data-state="untested"] .node-glyph { color: var(--muted); }
.node.is-draft .node-chip { border-style: dotted; border-color: var(--agent); }
.node.is-draft .node-tag { background: var(--agent); }
.node.is-ghost .node-chip { border: 1.5px dashed var(--agent); background: rgba(220, 240, 238, .6); color: var(--agent-ink); box-shadow: none; }
.node.is-ghost .node-tag { background: var(--agent); }
.node.is-orphan .node-tag { background: var(--bad); }
.node.goal .node-chip { border-radius: 2px; border-color: var(--ink); min-height: 56px; }
.node.goal[data-verified="true"] .node-chip { background: var(--ink); color: #fff; }
.node.is-selected .node-chip { border-color: var(--you); border-style: solid; box-shadow: 0 0 0 3px var(--you-tint), 0 0 0 4.5px var(--you); }
.node.is-dim { opacity: .28; }
.node.is-open { z-index: 6; }
.node.is-open .node-chip, .node.is-open .node-tag, .node.is-open .node-actions { visibility: hidden; }
.node-actions { position: absolute; left: 0; top: 100%; margin-top: 4px; display: flex; gap: 4px; }
.node-actions .btn { min-height: 24px; padding: 0 8px; font-size: 11px; }
@media (hover: hover) { .node-chip:hover { border-color: var(--ink); } }
.node.pulse .node-chip { animation: statePulse 1200ms var(--ease-out) 1; }
@keyframes statePulse {
  0% { box-shadow: 0 0 0 0 rgba(20, 24, 29, .6); }
  100% { box-shadow: 0 0 0 26px rgba(20, 24, 29, 0); }
}
[data-zoom="far"] .node-title, [data-zoom="far"] .node-tag, [data-zoom="far"] .node-actions { display: none; }
[data-zoom="far"] .node-chip { justify-content: center; }
[data-zoom="far"] .node-glyph { --od-icon-size: 30px; }
[data-zoom="far"] .sticky, [data-zoom="far"] .doccard { opacity: .5; }

/* frame: lives inside its node at quarter scale, so zooming in is what opens it */
.node-frame { position: absolute; left: 0; top: 0; width: 760px; transform: scale(.25); transform-origin: 0 0; cursor: auto; }
.node:not(.is-open) .node-frame { display: none; }
.frame { background: var(--surface); border: 2px solid var(--ink); border-radius: var(--r3); box-shadow: var(--shadow); overflow: hidden; }
.frame-head { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s3); padding: var(--s4) var(--s5); border-bottom: 1px solid var(--line); }
.frame-title { font-size: var(--fs-xl); flex: 1 1 200px; min-width: 0; overflow-wrap: anywhere; }
.frame-state { display: inline-flex; align-items: center; gap: 6px; font-size: var(--fs-sm); font-weight: 600; --od-icon-size: 18px; }
.frame-tabs { display: flex; gap: 2px; width: 100%; padding: 3px; border: 1px solid var(--line-strong); border-radius: var(--r2); }
.frame-tabs .tab { flex: 1 1 0; }
.tab {
  min-height: 32px; padding: 0 var(--s3); border: 0; border-radius: 6px; background: transparent;
  font-size: var(--fs-md); font-weight: 600; color: var(--ink-2); white-space: nowrap;
}
.tab[aria-selected="true"] { background: var(--ink); color: #fff; }
.block { padding: var(--s4) var(--s5); border-bottom: 1px solid var(--line); }
.block:last-child { border-bottom: 0; }
.block.is-selected { box-shadow: inset 0 0 0 2px var(--you); background: #FAFBFF; }
.block-head { display: flex; align-items: center; gap: var(--s2); margin-bottom: var(--s2); }
.block-type { font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.author { padding: 0 6px; border-radius: 8px; font-size: 11px; font-weight: 600; line-height: 18px; }
.author[data-who="agent"] { background: var(--agent-tint); color: var(--agent-ink); }
.author[data-who="you"] { background: var(--ink); color: #fff; }
.block-body { max-width: 68ch; overflow-wrap: anywhere; }
.block-problem .block-body, .block-answer .block-body, .block-code .block-body, .block-diagram .block-body { max-width: none; }
[data-zoom="near"] .node:not(.is-open) { opacity: .35; }
.block[data-author="agent"] .block-body { color: var(--agent-ink); }
.block-body code, .inline-code { font-family: var(--font-mono); font-size: .92em; padding: 1px 4px; border-radius: var(--r1); background: var(--surface-2); }
.summary-line { font-family: var(--font-display); font-size: var(--fs-lg); font-weight: 700; line-height: 1.3; }
.code {
  margin: 0; padding: var(--s3) var(--s4); min-height: 48px;
  background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r2);
  font-family: var(--font-mono); font-size: 15px; line-height: 1.6; white-space: pre-wrap; overflow-wrap: anywhere;
  color: var(--agent-ink);
}
.code code { font: inherit; }
.caret { display: inline-block; width: 2px; height: 1.1em; vertical-align: text-bottom; background: var(--agent); animation: blink 900ms steps(2) infinite; }
@keyframes blink { 50% { opacity: 0; } }
mark.hl-agent { background: var(--agent-tint); color: inherit; box-shadow: 0 -2px 0 var(--agent) inset; border-radius: 2px; padding: 1px 0; }
mark.sel-agent { background: var(--agent); color: #fff; border-radius: 2px; }
.edited { box-shadow: 0 -2px 0 var(--agent) inset; }
.out { margin-top: var(--s2); padding: var(--s2) var(--s4); border: 1px dashed var(--line-strong); border-radius: var(--r2); font-family: var(--font-mono); font-size: 15px; white-space: pre-wrap; overflow-wrap: anywhere; color: var(--ink); }
.out-label { display: block; font-family: var(--font-body); font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.out.is-error { color: var(--bad); border-color: var(--bad); }
.block-actions { display: flex; flex-wrap: wrap; gap: var(--s2); margin-top: var(--s3); }
.diagram { display: block; width: 100%; height: auto; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r2); }
.diagram .stroke { fill: none; stroke: var(--agent); stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.diagram text { font: 500 16px var(--font-mono); fill: var(--agent-ink); }
.problem-text { font-weight: 500; white-space: pre-wrap; }
.problem-text pre { font-family: var(--font-mono); font-size: 15px; margin: var(--s2) 0 0; padding: var(--s3) var(--s4); background: var(--surface-2); border-radius: var(--r2); white-space: pre-wrap; }
.varies { display: inline-block; margin-bottom: var(--s2); padding: 2px 8px; border: 1px solid var(--line-strong); border-radius: 10px; font-size: var(--fs-xs); font-weight: 600; color: var(--ink-2); }
.answer-grid { display: grid; grid-template-columns: minmax(0, 1fr) 208px; gap: var(--s4); align-items: start; }
.answer {
  display: block; width: 100%; min-height: 104px; padding: var(--s3);
  border: 2px solid var(--ink); border-radius: var(--r2); background: var(--surface);
  font-family: var(--font-mono); font-size: 15px; line-height: 1.6; color: var(--ink); resize: vertical;
}
.answer.prose { font-family: var(--font-body); font-size: var(--fs-body); }
.answer-label { display: block; margin-bottom: var(--s1); font-size: var(--fs-sm); font-weight: 600; }
.answer-hint { display: block; font-size: var(--fs-xs); color: var(--muted); font-weight: 400; }
.margin-note { padding: var(--s2) var(--s3); border: 1.5px dashed var(--agent); border-radius: var(--r2); background: var(--agent-tint); color: var(--agent-ink); font-size: var(--fs-md); line-height: 1.45; }
.margin-note strong { display: block; font-size: var(--fs-xs); letter-spacing: .06em; text-transform: uppercase; }
.margin-note pre { margin: var(--s1) 0 0; font-family: var(--font-mono); font-size: 13px; white-space: pre-wrap; }
.margin-empty { font-size: var(--fs-xs); color: var(--muted); border: 1px dashed var(--line-strong); border-radius: var(--r2); padding: var(--s2) var(--s3); }
.feedback { margin-top: var(--s3); padding: var(--s2) var(--s3); border-radius: var(--r2); border: 1.5px solid; font-size: var(--fs-md); }
.feedback strong { display: block; }
.feedback[data-kind="ok"] { border-color: var(--ok); background: var(--ok-tint); color: #12452A; }
.feedback[data-kind="missing"] { border-color: var(--ready); background: var(--ready-tint); color: var(--ready-ink); }
.feedback[data-kind="rule"] { border-color: var(--bad); background: var(--bad-tint); color: #7A2112; }
.chips { display: flex; flex-wrap: wrap; gap: var(--s2); }
.chip {
  display: inline-flex; align-items: center; min-height: 28px; padding: 0 10px;
  border: 1px solid var(--line-strong); border-radius: 14px; background: var(--surface);
  font-size: var(--fs-sm); font-weight: 500; color: var(--ink);
}
button.chip[aria-pressed="true"] { background: var(--ink); color: #fff; border-color: var(--ink); }
.chip.struck { text-decoration: line-through; color: var(--muted); border-style: dashed; }
.empty { padding: var(--s5); text-align: left; }
.empty h3 { font-size: var(--fs-lg); margin-bottom: var(--s2); }
.empty p { color: var(--ink-2); max-width: 60ch; margin-bottom: var(--s3); }
.empty ol { margin: 0 0 var(--s4); padding-left: 20px; color: var(--ink-2); }
.ev { border: 1px solid var(--line); border-radius: var(--r2); margin-top: var(--s2); }
.ev summary { display: flex; align-items: center; gap: var(--s2); padding: var(--s2) var(--s3); cursor: pointer; font-size: var(--fs-md); font-weight: 500; list-style: none; }
.ev summary::-webkit-details-marker { display: none; }
.ev-kind { flex: none; padding: 0 6px; border-radius: 8px; font-size: 11px; font-weight: 600; line-height: 18px; border: 1px solid; }
.ev[data-kind="can"] .ev-kind { color: var(--ok); }
.ev[data-kind="confuses"] .ev-kind { color: var(--bad); }
.ev[data-kind="untested"] .ev-kind { color: var(--muted); border-style: dashed; }
.attempt { padding: var(--s2) var(--s3) var(--s3); border-top: 1px solid var(--line); font-size: var(--fs-sm); color: var(--ink-2); }
.attempt pre { margin: var(--s1) 0; padding: var(--s2); background: var(--surface-2); border-radius: var(--r1); font-family: var(--font-mono); font-size: 12px; white-space: pre-wrap; color: var(--ink); }
.source { display: grid; gap: 2px; padding: var(--s2) var(--s3); border: 1px solid var(--line); border-radius: var(--r2); margin-top: var(--s2); font-size: var(--fs-md); }
.source a { color: var(--you); overflow-wrap: anywhere; }
.source small { color: var(--muted); font-size: var(--fs-xs); }
.skill { display: grid; gap: 4px; margin-top: var(--s2); font-size: var(--fs-md); }
.skill-bar { display: block; height: 6px; border-radius: 3px; background: var(--line); overflow: hidden; }
.skill-bar i { display: block; height: 100%; width: 100%; background: var(--ink); transform-origin: 0 50%; transition: transform var(--t-med) var(--ease-out); }
.skill small { color: var(--muted); font-size: var(--fs-xs); }
.meta-row { display: grid; grid-template-columns: 128px minmax(0, 1fr); gap: var(--s2); padding: 6px 0; font-size: var(--fs-md); border-bottom: 1px solid var(--line); }
.meta-row:last-child { border-bottom: 0; }
.meta-row dt { color: var(--muted); }
.meta-row dd { margin: 0; }
dl { margin: 0; }
.frame-foot { display: flex; align-items: center; gap: var(--s3); padding: var(--s3) var(--s5); border-top: 1px solid var(--line); background: var(--surface-2); font-size: var(--fs-sm); }
.frame-foot input[type="range"] { flex: 1 1 0; min-width: 0; accent-color: var(--agent); }
.predict { padding: var(--s3) var(--s4); border: 1px solid var(--quiet-line); border-radius: var(--r2); font-size: var(--fs-md); }
.result-row { display: flex; gap: var(--s2); align-items: baseline; padding: 6px 0; border-bottom: 1px solid var(--quiet-line); font-size: var(--fs-md); }
.result-mark { flex: none; width: 48px; font-weight: 600; }

/* check mode: a quiet, distinct state of the frame */
.frame[data-mode="check"] { background: var(--quiet-bg); color: var(--quiet-ink); border-color: #000; }
.frame[data-mode="check"] .frame-head, .frame[data-mode="check"] .block { border-color: var(--quiet-line); }
.frame[data-mode="check"] .frame-tabs { border-color: var(--quiet-line); }
.frame[data-mode="check"] .tab { color: var(--quiet-muted); }
.frame[data-mode="check"] .tab[aria-selected="true"] { background: var(--quiet-ink); color: var(--quiet-bg); }
.frame[data-mode="check"] .block-type, .frame[data-mode="check"] .answer-hint { color: var(--quiet-muted); }
.frame[data-mode="check"] .block.is-selected { background: var(--quiet-surface); }
.frame[data-mode="check"] .answer { background: var(--quiet-surface); color: var(--quiet-ink); border-color: var(--quiet-ink); }
.frame[data-mode="check"] .problem-text pre { background: var(--quiet-surface); color: var(--quiet-ink); }
.frame[data-mode="check"] .btn-primary { background: var(--quiet-ink); color: var(--quiet-bg); border-color: var(--quiet-ink); }
.frame[data-mode="check"] .btn-surface { background: transparent; color: var(--quiet-ink); border-color: var(--quiet-muted); }
.frame[data-mode="check"] .empty p, .frame[data-mode="check"] .empty ol { color: var(--quiet-muted); }
.frame[data-mode="check"] .frame-foot { display: none; }
.quiet-note { font-size: var(--fs-sm); color: var(--quiet-muted); }

/* stickies and doc cards on the canvas */
.sticky {
  position: absolute; width: 200px; padding: 10px 12px; border-radius: var(--r1);
  background: #FFFFFF; border: 1.5px solid var(--ink); font-size: 12px; line-height: 1.45; cursor: grab;
  box-shadow: 2px 3px 0 rgba(20, 24, 29, .12);
}
.sticky[data-author="agent"] { border-color: var(--agent); background: var(--agent-tint); color: var(--agent-ink); }
.sticky.is-unpinned { border-style: dashed; box-shadow: none; }
.sticky.is-selected, .doccard.is-selected { outline: 2px solid var(--you); outline-offset: 2px; }
.sticky-text { display: block; width: 100%; min-height: 48px; border: 0; background: transparent; resize: none; font: inherit; color: inherit; padding: 0; }
.sticky-foot { display: flex; justify-content: space-between; align-items: center; gap: 6px; margin-top: 6px; font-size: 10px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; }
.sticky-foot .btn { min-height: 22px; padding: 0 6px; font-size: 10px; text-transform: none; letter-spacing: 0; }
.doccard {
  position: absolute; width: 200px; padding: 10px 12px; border-radius: var(--r2);
  background: var(--surface); border: 1.5px solid var(--ink-2); font-size: 12px; line-height: 1.4; cursor: grab;
  box-shadow: var(--shadow);
}
.doccard-kind { font-size: 10px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.doccard-name { font-weight: 600; font-size: 13px; }
.doccard-excerpt { margin-top: 6px; font-family: var(--font-mono); font-size: 10.5px; color: var(--ink-2); white-space: pre-wrap; }
.doccard img { margin-top: 6px; border-radius: var(--r1); }

/* ---------- chrome ---------- */
.topbar {
  position: fixed; left: var(--s3); right: var(--s3); top: var(--s3); z-index: 20;
  display: flex; align-items: center; gap: var(--s3); pointer-events: none;
}
.topbar > * { pointer-events: auto; }
.goalbar {
  flex: 1 1 0; min-width: 0; display: flex; align-items: center; gap: var(--s3);
  min-height: 42px; padding: 0 var(--s4);
  background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--r2);
  text-align: left; box-shadow: var(--shadow);
}
.goalbar-label { flex: none; font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.goalbar-text { flex: 1 1 0; min-width: 0; font-family: var(--font-display); font-weight: 700; font-size: 17px; }
.goalbar-count { flex: none; font-size: var(--fs-md); font-weight: 600; }
.top-actions { display: flex; align-items: center; gap: var(--s2); flex: none; }
.topbar .seg, .top-actions .btn { box-shadow: var(--shadow); background-color: var(--surface); }
.top-actions .btn-toggle[aria-pressed="true"] { background-color: var(--agent-tint); }

.menu { position: relative; }
.menu > summary { list-style: none; }
.menu > summary::-webkit-details-marker { display: none; }
.menu-pop {
  position: absolute; z-index: 25; width: 264px; padding: var(--s4);
  display: grid; gap: var(--s3);
  background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--r2); box-shadow: var(--shadow);
}
.menu-pop-right { right: 0; top: calc(100% + 8px); }
.menu-pop-up { left: 0; bottom: calc(100% + 8px); }
.menu-title { font-size: var(--fs-sm); font-weight: 600; }
.menu-note { font-size: var(--fs-xs); color: var(--muted); }
.check { display: flex; align-items: center; gap: var(--s2); font-size: var(--fs-md); }
.check input { width: 16px; height: 16px; accent-color: var(--ink); }
.legend-row { display: grid; grid-template-columns: 22px 84px minmax(0, 1fr); gap: var(--s2); align-items: start; font-size: var(--fs-sm); --od-icon-size: 18px; }
.legend-row b { font-weight: 600; }
.legend-row span { color: var(--ink-2); }

.side-toggle { position: fixed; left: var(--s3); top: calc(var(--bar-h) + var(--s3)); z-index: 21; background: var(--surface); border-color: var(--line-strong); box-shadow: var(--shadow); min-height: 32px; font-size: var(--fs-sm); }
.side {
  position: fixed; left: var(--s3); top: calc(var(--bar-h) + var(--s3) + 40px); bottom: 136px; z-index: 20;
  width: var(--side-w); display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--r3); box-shadow: var(--shadow);
  transition: transform var(--t-med) var(--ease-out), opacity var(--t-med) var(--ease-out);
}
.side.is-closed { transform: translateX(-16px); opacity: 0; pointer-events: none; visibility: hidden; transition: transform var(--t-exit) var(--ease-in), opacity var(--t-exit) var(--ease-in), visibility 0s var(--t-exit); }
.side-body { padding: var(--s4); flex: 1 1 0; }
.side-title { font-size: var(--fs-lg); margin-bottom: var(--s1); }
.side-lede { font-size: var(--fs-sm); color: var(--ink-2); margin-bottom: var(--s4); }
.side-section { padding: var(--s3) 0; border-top: 1px solid var(--line); }
.side-h { font-family: var(--font-body); font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-bottom: var(--s2); }
.list { display: grid; gap: var(--s2); margin: 0; padding: 0; list-style: none; }
.list-btn {
  display: flex; align-items: center; gap: var(--s2); width: 100%; min-height: 40px; padding: 6px 10px;
  border: 1px solid var(--line-strong); border-radius: var(--r2); background: var(--surface); text-align: left;
  font-size: var(--fs-md); font-weight: 500; --od-icon-size: 18px;
}
.list-btn small { display: block; font-size: var(--fs-xs); color: var(--muted); font-weight: 400; }
.list-btn[data-state="ready"] { border-color: var(--ready); }
.list-btn[data-state="ready"] .od-icon { color: var(--ready-ink); }
@media (hover: hover) { .list-btn:hover { border-color: var(--ink); } }
.stepper { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 2px; padding: 3px; border: 1px solid var(--line-strong); border-radius: var(--r2); margin-bottom: var(--s4); }
.step { min-height: 44px; padding: 2px; border: 0; border-radius: 6px; background: transparent; font-size: var(--fs-xs); font-weight: 600; color: var(--ink-2); line-height: 1.2; }
.step b { display: block; font-size: 11px; color: var(--muted); font-weight: 600; }
.step[aria-current="step"] { background: var(--ink); color: #fff; }
.step[aria-current="step"] b { color: #C9D0D8; }
.task-row { display: flex; gap: var(--s2); align-items: flex-start; padding: 6px 0; font-size: var(--fs-md); }
.task-row input { flex: none; margin-top: 3px; width: 16px; height: 16px; accent-color: var(--ink); }
.epi-card { display: grid; gap: var(--s1); padding: var(--s3); border: 1px solid var(--line-strong); border-radius: var(--r2); background: var(--surface); text-align: left; width: 100%; font-size: var(--fs-sm); }
.epi-card b { font-size: var(--fs-md); }
.epi-card[aria-pressed="true"] { border: 2px solid var(--ink); }
.epi-card small { color: var(--muted); font-size: var(--fs-xs); }
.idea-row { display: flex; align-items: center; gap: 4px; }
.idea-row input { flex: 1 1 0; min-width: 0; min-height: 32px; padding: 0 8px; border: 1px solid var(--line-strong); border-radius: var(--r1); font-size: var(--fs-sm); background: var(--surface); }
.idea-row .btn { min-height: 28px; padding: 0 6px; font-size: 11px; }
.branch-row { display: grid; gap: 4px; padding: var(--s2) 0; border-bottom: 1px solid var(--line); font-size: var(--fs-md); }
.branch-row:last-child { border-bottom: 0; }
.branch-row small { color: var(--muted); font-size: var(--fs-xs); }
.cov-row { display: grid; gap: 4px; width: 100%; padding: var(--s2); border: 1px solid var(--line-strong); border-radius: var(--r2); background: var(--surface); text-align: left; font-size: var(--fs-sm); }
.cov-row[aria-pressed="true"] { border: 2px solid var(--ink); }
.path-chip { display: inline-block; margin: 2px 4px 0 0; padding: 0 6px; border-radius: 8px; background: var(--surface-2); border: 1px solid var(--line); font-size: 11px; line-height: 18px; }
.gap { color: var(--bad); font-weight: 600; font-size: var(--fs-xs); }
.status-line { display: flex; align-items: center; gap: var(--s2); padding: var(--s2) var(--s3); border: 1px solid var(--line-strong); border-radius: var(--r2); font-size: var(--fs-md); font-weight: 600; margin-bottom: var(--s3); }
.field-label { display: block; font-size: var(--fs-sm); font-weight: 600; margin-bottom: 4px; }

.zoomctl { position: fixed; left: var(--s3); bottom: var(--s3); z-index: 20; display: flex; align-items: center; gap: var(--s1); padding: 4px; background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--r2); box-shadow: var(--shadow); }
.zoomctl .iconbtn { width: 32px; height: 32px; border-color: transparent; }
.zoomctl .btn { min-height: 32px; border-color: transparent; font-size: var(--fs-sm); }
.zoom-label { min-width: 56px; text-align: center; font-size: var(--fs-sm); font-weight: 600; }

.inputbar {
  position: fixed; left: 50%; bottom: var(--s3); z-index: 22; transform: translateX(-50%);
  width: min(880px, calc(100vw - 560px)); display: flex; align-items: flex-end; gap: var(--s2);
  pointer-events: none;
}
.inputbar > * { pointer-events: auto; }
.input-main { position: relative; flex: 1 1 0; min-width: 0; padding: var(--s2); background: var(--surface); border: 1.5px solid var(--ink); border-radius: var(--r3); box-shadow: var(--shadow); }
.input-row { display: flex; align-items: center; gap: var(--s2); }
.msg { flex: 1 1 0; min-width: 0; min-height: 40px; padding: 0 var(--s2); border: 0; background: transparent; font-size: var(--fs-body); }
.msg:focus { outline: none; }
.input-main:focus-within { box-shadow: 0 0 0 3px var(--you-tint), var(--shadow); border-color: var(--you); }
.msg::placeholder { color: var(--muted); }
.input-side { display: flex; gap: var(--s2); flex: none; }
.input-side .btn { min-height: 44px; box-shadow: var(--shadow); }
.ctx { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 0 var(--s2); }
.ctx-chip { display: inline-flex; align-items: center; gap: 4px; max-width: 260px; min-height: 26px; padding: 0 4px 0 8px; border-radius: 13px; background: var(--you-tint); color: #1A2F96; font-size: var(--fs-sm); font-weight: 500; }
.ctx-chip button { width: 20px; height: 20px; border: 0; border-radius: 50%; background: transparent; color: inherit; font-size: 14px; line-height: 1; flex: none; }
.ctx-label { font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); align-self: center; }
.mention { position: absolute; left: var(--s2); bottom: calc(100% + 6px); width: min(320px, 100%); max-height: 220px; overflow-y: auto; padding: 4px; background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--r2); box-shadow: var(--shadow); }
.mention-item { display: block; width: 100%; padding: 6px 8px; border: 0; border-radius: var(--r1); background: transparent; text-align: left; font-size: var(--fs-md); }
.mention-item[aria-selected="true"] { background: var(--you-tint); }
.mention-empty { padding: 6px 8px; font-size: var(--fs-sm); color: var(--muted); }

.moment {
  position: fixed; left: 50%; bottom: 96px; z-index: 23; transform: translateX(-50%);
  width: min(600px, calc(100vw - 32px)); padding: var(--s4) var(--s5);
  background: var(--surface); border: 2px solid var(--ink); border-radius: var(--r3); box-shadow: var(--shadow);
  animation: rise var(--t-med) var(--ease-out);
}
@keyframes rise { from { opacity: 0; transform: translateX(-50%) translateY(12px); } }
.moment h2 { font-size: var(--fs-lg); margin-bottom: var(--s1); }
.moment p { font-size: var(--fs-md); color: var(--ink-2); margin-bottom: var(--s3); }
.moment .chips { margin-bottom: var(--s3); }
.moment button.chip { min-height: 36px; }
.moment-note { font-size: var(--fs-sm); color: var(--agent-ink); font-weight: 500; }

.agent-dock { position: fixed; right: 0; top: 40%; width: 8px; height: 8px; pointer-events: none; }

.drawer {
  position: fixed; right: var(--s3); top: calc(var(--bar-h) + var(--s3)); bottom: var(--s3); z-index: 30;
  width: min(var(--drawer-w), calc(100vw - 24px)); display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--r3); box-shadow: var(--shadow);
  animation: slideIn var(--t-med) var(--ease-out);
}
@keyframes slideIn { from { opacity: 0; transform: translateX(16px); } }
.drawer-head { display: flex; align-items: center; gap: var(--s2); padding: var(--s2); border-bottom: 1px solid var(--line); }
.tabs { display: flex; flex: 1 1 0; min-width: 0; gap: 2px; overflow-x: auto; }
.drawer .tab { padding: 0 var(--s2); font-size: var(--fs-sm); }
.drawer-body { flex: 1 1 0; }
.pane { padding: var(--s4); }
.pane-title { font-size: var(--fs-lg); margin-bottom: var(--s1); }
.pane-lede { font-size: var(--fs-sm); color: var(--ink-2); margin-bottom: var(--s4); }
.msgline { padding: var(--s2) 0; border-bottom: 1px solid var(--line); font-size: var(--fs-md); overflow-wrap: anywhere; }
.msg-who { display: flex; gap: var(--s2); align-items: baseline; font-size: var(--fs-xs); font-weight: 600; margin-bottom: 2px; }
.msg-who time { font-weight: 400; color: var(--muted); }
.msgline[data-who="agent"] .msg-who b { color: var(--agent-ink); }
.msgline[data-who="agent"] .msg-text { color: var(--agent-ink); }
.msg-ctx { display: block; font-size: var(--fs-xs); color: var(--muted); margin-top: 2px; }
.dropnote { padding: var(--s3); border: 1.5px dashed var(--line-strong); border-radius: var(--r2); font-size: var(--fs-sm); color: var(--ink-2); margin-bottom: var(--s3); }
.dropnote .btn { margin-top: var(--s2); }
.doc-item { padding: var(--s3); border: 1px solid var(--line-strong); border-radius: var(--r2); margin-bottom: var(--s2); }
.doc-item.is-selected { border: 2px solid var(--you); }
.doc-item.flash { animation: flash 1400ms var(--ease-out) 1; }
@keyframes flash { 0% { background: var(--you-tint); } 100% { background: transparent; } }
.doc-top { display: flex; align-items: flex-start; gap: var(--s2); }
.doc-badge { flex: none; min-width: 40px; padding: 2px 4px; border: 1px solid var(--ink-2); border-radius: var(--r1); font-size: 10px; font-weight: 600; letter-spacing: .06em; text-align: center; text-transform: uppercase; }
.doc-name { font-size: var(--fs-md); font-weight: 600; }
.doc-meta { font-size: var(--fs-xs); color: var(--muted); }
.doc-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: var(--s2); }
.doc-preview { margin-top: var(--s2); max-height: 240px; overflow: auto; padding: var(--s2); background: var(--surface-2); border-radius: var(--r1); font-family: var(--font-mono); font-size: 12px; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; }
.doc-preview.is-image { max-height: none; padding: 0; background: transparent; }
.doc-preview img { border-radius: var(--r1); }
.progress { display: block; height: 4px; margin-top: var(--s2); border-radius: 2px; background: var(--line); overflow: hidden; }
.progress i { display: block; height: 100%; width: 100%; background: var(--you); transform: scaleX(0); transform-origin: 0 50%; transition: transform 200ms linear; }
.rev { padding: var(--s3) 0; border-bottom: 1px solid var(--line); font-size: var(--fs-md); }
.rev b { display: block; }
.rev small { display: block; color: var(--muted); font-size: var(--fs-xs); }
.rev p { color: var(--ink-2); font-size: var(--fs-sm); }
.due-item { display: grid; gap: var(--s1); padding: var(--s3); border: 1px solid var(--line-strong); border-radius: var(--r2); margin-bottom: var(--s2); font-size: var(--fs-md); }
.due-item small { color: var(--muted); font-size: var(--fs-xs); }
.due-item .btn { justify-self: start; }

/* agent cursors */
.cursors { position: fixed; inset: 0; z-index: 40; pointer-events: none; overflow: hidden; }
.cursor { position: absolute; left: 0; top: 0; --c: var(--agent); will-change: transform; }
.cursor[data-id="agent2"] { --c: var(--agent-2); }
.cursor-arrow { display: block; width: 20px; height: 22px; color: var(--c); filter: drop-shadow(0 1px 1px rgba(0, 0, 0, .3)); }
.cursor-tag { position: absolute; left: 16px; top: 18px; display: flex; gap: 6px; align-items: center; padding: 2px 8px; border-radius: 4px 10px 10px 10px; background: var(--c); color: #fff; font-size: 12px; font-weight: 600; white-space: nowrap; }
.cursor-state { font-weight: 400; opacity: .92; }
.cursor-bubble {
  position: absolute; left: 16px; top: 46px; width: max-content; max-width: 260px; padding: 8px 10px;
  background: var(--surface); border: 1.5px solid var(--c); border-radius: 4px 10px 10px 10px; color: var(--ink);
  font-size: 13px; line-height: 1.4; box-shadow: var(--shadow);
  animation: pop var(--t-fast) var(--ease-out);
}
.cursor.flip .cursor-bubble { left: auto; right: 4px; border-radius: 10px 4px 10px 10px; }
.cursor.flip .cursor-tag { left: auto; right: 4px; border-radius: 10px 4px 10px 10px; }
@keyframes pop { from { opacity: 0; transform: translateY(-4px); } }
.cursor.is-paused .cursor-tag { background: var(--ink); }

.toasts { position: fixed; left: 50%; top: calc(var(--bar-h) + var(--s4)); z-index: 50; transform: translateX(-50%); display: grid; gap: var(--s2); justify-items: center; pointer-events: none; }
.toast { display: flex; align-items: center; gap: var(--s3); padding: var(--s2) var(--s4); background: var(--ink); color: #fff; border-radius: var(--r2); font-size: var(--fs-md); pointer-events: auto; animation: pop var(--t-med) var(--ease-out); max-width: min(520px, calc(100vw - 32px)); }
.toast button { border: 1px solid #fff; background: transparent; color: #fff; border-radius: var(--r1); padding: 2px 8px; font-size: var(--fs-sm); font-weight: 600; flex: none; }

.dialog { width: min(480px, calc(100vw - 32px)); padding: var(--s6); border: 2px solid var(--ink); border-radius: var(--r3); background: var(--surface); color: var(--ink); }
.dialog::backdrop { background: rgba(20, 24, 29, .45); }
.dialog h2 { font-size: var(--fs-lg); margin-bottom: var(--s2); }
.dialog ul { margin: var(--s2) 0; padding-left: 20px; font-size: var(--fs-md); }
.dialog p { font-size: var(--fs-md); color: var(--ink-2); }
.dialog-actions { display: flex; justify-content: flex-end; gap: var(--s2); margin-top: var(--s5); }

/* ---------- responsive ---------- */
@media (max-width: 1100px) {
  .inputbar { left: var(--s3); right: var(--s3); width: auto; transform: none; bottom: 60px; }
  .moment { bottom: 148px; }
  .side { bottom: 132px; }
}
@media (max-width: 767px) {
  :root { --bar-h: 108px; }
  .topbar { flex-wrap: wrap; gap: var(--s2); }
  .goalbar { order: 3; flex: 1 1 100%; }
  .top-actions { margin-left: auto; }
  #paceMenu { display: none; }
  .side { width: auto; right: var(--s3); bottom: 180px; }
  .inputbar { flex-direction: column; align-items: stretch; bottom: 60px; }
  .input-side { justify-content: flex-end; }
  .input-side .btn { min-height: 40px; }
  .moment { bottom: 196px; }
  .zoomctl #legend { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 1ms !important; transition-duration: 1ms !important; }
  .caret { animation: none; }
}

/* ---------- shared additions ---------- */

.canvas { user-select: none; -webkit-user-select: none; }
.world { width: 0; height: 0; }
.world.smooth { transition: transform 440ms var(--ease-out); }
.node-chip { font-family: inherit; cursor: pointer; }
.node-frame, .frame { user-select: text; -webkit-user-select: text; }
.node.goal .node-chip { width: 100%; }
.side-body ul { margin: 0; padding: 0; list-style: none; }

.welcome {
  position: absolute; left: 50%; top: 42%; transform: translate(-50%, -50%);
  width: min(560px, calc(100vw - 48px)); text-align: center; pointer-events: none;
}
.welcome h1 { font-size: var(--fs-xl); margin-bottom: var(--s2); }
.welcome p { color: var(--ink-2); }

/* anything the agent points at or changes pulses once */
.pulse:not(.node) { animation: statePulse 1200ms var(--ease-out) 1; }

/* a button that cannot be used looks it */
.btn:disabled, .iconbtn:disabled, .seg-btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-primary:disabled { opacity: 1; }

/* map chips: a fixed size with the title cut to fit, so neighbours never overlap */
.node-chip { height: 64px; min-height: 0; overflow: hidden; }
.node-title { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow: hidden; overflow-wrap: anywhere; }
.node.goal .node-chip { min-height: 0; align-items: flex-start; padding-top: 8px; }
.node.goal .node-title { -webkit-line-clamp: 4; }
/* fold or unfold what lies beneath a node */
.node-fold {
  position: absolute; left: 100%; top: 50%; transform: translate(-50%, -50%); z-index: 2;
  min-width: 22px; height: 22px; padding: 0 5px; border: 1.5px solid var(--line-strong); border-radius: 11px;
  background: var(--surface); color: var(--ink-2); font: 600 11px/1 var(--font-mono); cursor: pointer;
}
.node-fold.is-folded { border-color: var(--ink); background: var(--ink); color: #fff; }
@media (hover: hover) { .node-fold:hover { border-color: var(--ink); color: var(--ink); } .node-fold.is-folded:hover { color: #fff; } }
.node.is-open .node-fold { visibility: hidden; }
.node:not(.goal) .node-chip { padding-right: 16px; }
