/* The builder, v3's in v5's look (round 31; Rob, 23 Oct 2026: "Can you make the version 5 of the Builder based on
   Dashboard version 5? Let's see if it's too much or if we can find a middle ground"). The page, its parts and how
   they work are v3's, approved on 11 Sep 2026 (rail, workflow canvas, drawer; the guardrails in js/builder/model.js),
   so the class names are v3's and the reasons for each part are in v3's CLAUDE.md. What changed is the look: v5's
   tokens, type and icons, v5's frame around it (the sidebar, Settings, three themes), and v5's light, glass and
   material on the working parts too. Round 31 offered three looks (hints, balanced, full) behind a switch for the
   preview; Rob chose (23 Oct, round 32): "I think we keep v5 full and they can just adjust in the settings", and took
   two things out of it: the gold waves at the foot and the stone texture. So the switch is gone, and a reader's own
   Settings calm the page as they calm every v5 page: Material off takes the cards' depth, Glass and glow off the
   glass, the light under the picked card and the glows, More contrast the glows.

   The containment rule holds as v3 stated it: no brand hue and no band hue in the builder's own parts, so the brand
   switch is words. v5's chrome hues are the gold (the picked thing, the page you are on) and the warning orange (a
   draft, a missing language, a refusal); the one brand surface is the customer's card in the drawer (css/card.css),
   boxed and captioned. ----- */

/* The builder's own tokens, beside v5's (tokens.css). */
:root {
  --b-wire: var(--ink-2);                      /* the routes: v3's ink-2, 5.4:1 on the ivory canvas */
  --b-dot: rgba(22, 24, 28, .15);              /* the canvas's dotted ground */
  --b-pop: 0 14px 34px -12px rgba(16, 24, 40, .28), 0 2px 6px rgba(16, 24, 40, .07);   /* menus, popovers, bars */
  --b-lift: 0 8px 20px -10px rgba(16, 24, 40, .30);                                    /* a card under the pointer */
  --b-mono: ui-monospace, "Cascadia Mono", "SF Mono", Menlo, Consolas, monospace;     /* keys, not words */
}
:root[data-theme="dark"] {
  --b-wire: #7D8698;                           /* softer than ink-2 on navy; 4.8:1 on the canvas */
  --b-dot: rgba(232, 236, 242, .11);
  --b-pop: 0 18px 40px -14px rgba(0, 0, 0, .65), 0 2px 6px rgba(0, 0, 0, .35);
  --b-lift: 0 12px 26px -12px rgba(0, 0, 0, .7);
}
:root[data-contrast="more"] { --b-dot: rgba(22, 24, 28, .3); }
:root[data-theme="dark"][data-contrast="more"] { --b-wire: var(--ink-2); --b-dot: rgba(232, 236, 242, .26); }

/* The hidden attribute is display:none in the UA sheet only, so a later display:grid beats it (v3's fix, load-bearing
   for the drawer and the notice). On this page only: the frame's own [hidden] rules stay as they are. */
body[data-page="builder"] [hidden] { display: none !important; }

/* ---- the page: the builder fills the window beside the sidebar; nothing scrolls but its panes ---- */
/* No waves and no stone on this page (round 32; Rob, 23 Oct: "we removed the dots at the bottom, the golden dots …
   Let's remove the rock background as well … I think it's best to remove it"): js/look.js draws no waves' band here,
   and the stone's layer (frame.css, .shell::before) is not drawn, so the room frame.css keeps for the band goes too.
   The dashboard and the insights page keep both. */
body[data-page="builder"] .shell::before { content: none; }
body[data-page="builder"] .page { padding-bottom: 0; height: calc(100vh / var(--zoom, 1)); min-height: 0; }
.builder { flex: 1 1 auto; min-height: 0; display: grid; grid-template-rows: auto auto minmax(0, 1fr) auto; }
/* Rows pinned (v3): the notice is display:none until something happens, and auto-placement would slide the view up
   into its row. */
.bhead { grid-row: 1; } .notice { grid-row: 2; } .view { grid-row: 3; min-height: 0; overflow: hidden; } .bfoot { grid-row: 4; }

/* ---- the keys: v5's, drawn on v3's markup ---- */
/* .bbtn is the dashboard's quiet key (frame.css .btn-quiet); --primary the main key, ink in light and gold in dark;
   --ghost a key with no edge; --icon a square one. */
.bbtn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 34px; padding: 7px 12px;
  border: 1px solid color-mix(in srgb, var(--ink) 18%, transparent); border-radius: var(--radius-btn); background: transparent;
  color: var(--ink); font: 500 13.5px/1 var(--font); cursor: pointer; white-space: nowrap; text-decoration: none;
  transition: background-color .15s ease, color .15s ease, box-shadow .15s ease; }
.bbtn svg { flex: none; display: block; }
.bbtn:hover { background: var(--nav-hover); }
.bbtn:disabled { opacity: .42; cursor: default; }
.bbtn:disabled:hover { background: transparent; }
.bbtn--primary { background: var(--btn-bg); color: var(--btn-ink); border-color: var(--btn-bg); font-weight: 600; padding-inline: 16px; }
.bbtn--primary:hover { background: var(--btn-bg); box-shadow: inset 0 0 0 99px rgba(255, 255, 255, .08); }
.bbtn--icon { width: 34px; padding: 0; }
.bbtn--ghost { border-color: transparent; color: var(--ink-2); }
.bbtn--ghost:hover { color: var(--ink); }
.bbtn--nw { gap: 8px; padding-right: 6px; }
/* The segmented control (v3's .bseg, ui.js) is the filter bar's track (frame.css .track), so every switch on every
   v5 page is one control. */
.bseg { display: inline-flex; gap: 2px; padding: 3px; border-radius: 10px; background: var(--chip-track); max-width: 100%; }
.bseg button { border: 0; background: none; color: var(--ink-2); font: 500 13px/1 var(--font); padding: 7px 11px; border-radius: 8px; cursor: pointer; white-space: nowrap;
  transition: background-color .15s ease, color .15s ease, box-shadow .15s ease; }
.bseg button[aria-pressed="true"] { background: var(--chip-on); color: var(--chip-on-ink); box-shadow: var(--chip-on-shadow); font-weight: 600; }
/* Chips are the dashboard's badges: the draft in the warning orange (a state: there are unsaved edits); Not wired
   neutral, like the insights page's Sample mark (one look for every honesty mark), its edge dashed for a placeholder. */
.chip { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 999px; border: 1px solid transparent;
  font: 500 11.5px/1.3 var(--font); color: var(--ink-2); background: var(--panel-2); white-space: nowrap; }
.chip--draft { color: var(--warn); background: color-mix(in srgb, var(--warn) 9%, var(--panel)); border-color: color-mix(in srgb, var(--warn) 35%, transparent); font-weight: 600; }
.chip--nw { border: 1px dashed color-mix(in srgb, var(--ink) 30%, transparent); cursor: pointer; }
button.chip--nw:hover { color: var(--ink); }
.bbtn--nw .chip--nw { cursor: inherit; padding: 2px 8px; }
.mono { font: 12px/1.4 var(--b-mono); color: var(--ink-2); }
@media (forced-colors: active) { .bseg button[aria-pressed="true"] { outline: 2px solid CanvasText; } }

/* ---- the header: the page's name, which questionnaire, and the page's keys ---- */
/* The dashboard's header band (the second glass surface, frame.css), as a toolbar: lower, the title smaller, no waves
   and no greeting. Wraps on a narrow window rather than overlapping (v3: min-width 0 and flex-wrap on both groups). */
.bhead { position: relative; z-index: 2; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 18px;
  padding: 14px 24px; border-bottom: 1px solid var(--line); }
.bhead-l { display: flex; align-items: center; gap: 10px 16px; min-width: 0; flex-wrap: wrap; }
.btitle { margin: 0; font: 600 22px/1.15 var(--font-title); letter-spacing: -.01em; color: var(--ink); }
.top-l, .top-r { display: flex; align-items: center; gap: 8px; min-width: 0; flex-wrap: wrap; }
.top-r { justify-content: flex-end; }
.top-pair { display: inline-flex; gap: 2px; }
:root[data-glass="off"] .bhead.glass { background: transparent; }

/* ---- the notice: the answer to what was just done, under the keys that did it (v3) ---- */
.notice { padding: 9px 24px; font-size: 13px; background: var(--panel); border-bottom: 1px solid var(--line); box-shadow: inset 3px 0 0 var(--ink-3); }
.notice--warn { box-shadow: inset 3px 0 0 var(--warn); }
.notice--ok { box-shadow: inset 3px 0 0 var(--gold-word); }

/* ---- the one page: rail | workflow | drawer (v3's grid, its widths written by js/builder/splitters.js) ---- */
.view--one { display: grid; position: relative; --rail-w: 300px; --panel-w: 520px; grid-template-columns: var(--rail-w) minmax(0, 1fr); }
.view--one.has-panel { grid-template-columns: var(--rail-w) minmax(0, 1fr) var(--panel-w); }
.pane { overflow: auto; min-height: 0; }
.pane--rail { grid-column: 1; grid-row: 1; padding: 16px 12px 20px 14px; background: var(--panel); border-right: 1px solid var(--line); }
.flow { grid-column: 2; grid-row: 1; position: relative; display: grid; grid-template-rows: 1fr; overflow: hidden; min-width: 0; container: flow / inline-size; }
.pane--qpanel { grid-column: 3; grid-row: 1; background: var(--panel); border-left: 1px solid var(--line); padding: 0; display: grid; grid-template-rows: auto auto 1fr; align-content: start; }

/* ---- the rail: the questions in the order asked, the ending, the library ---- */
/* Section heads in sentence case (round 21: one tracked label on a page at most), in the gold words, as Settings'
   groups in dark: part of the full look Rob kept (round 32). */
.rail-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin: 22px 6px 8px; font: 600 13px/1.2 var(--font); color: var(--gold-word); }
.rail-head:first-child { margin-top: 2px; }
.rail-head > span + span { color: var(--ink-2); font-weight: 500; font-variant-numeric: tabular-nums; }
.qlist { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
/* A row is the sidebar's link: the same hover, and the picked question in the same gold pill as the page you are on. */
.qrow { display: grid; grid-template-columns: 26px 1fr auto; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border: 1px solid transparent;
  border-radius: 10px; background: transparent; color: var(--ink); cursor: pointer; text-align: left; transition: background-color .15s ease, color .15s ease; }
.qrow:hover { background: var(--nav-hover); }
.qrow[aria-current="true"] { background: color-mix(in srgb, var(--gold) 13%, transparent); color: var(--nav-on); font-weight: 600; }
.qrow.is-dragging { opacity: .4; }
.qrow.is-over-before { box-shadow: 0 -2px 0 var(--focus); }
.qrow.is-over-after { box-shadow: 0 2px 0 var(--focus); }
.qnum { display: grid; place-items: center; width: 26px; height: 22px; border-radius: 6px; background: var(--panel-2); border: 1px solid var(--line);
  font: 600 11px/1 var(--font); font-variant-numeric: tabular-nums; color: var(--ink-2); }
.qrow[aria-current="true"] .qnum { background: transparent; border-color: color-mix(in srgb, var(--gold) 55%, transparent); color: var(--gold-word); }
.qtitle { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.qtitle--empty { color: var(--ink-2); font-style: italic; font-weight: 400; }
.qmeta { display: flex; gap: 4px; align-items: center; }
/* Dots, not words: the rail is scanned (v3). A missing language in the warning orange, a question asked by both
   questionnaires in grey, a question that routes in gold, the colour of a picked route. */
.dot { width: 7px; height: 7px; border-radius: 50%; }
.dot--missing { background: var(--warn); }
.dot--shared { background: var(--ink-3); }
.dot--rules { background: var(--gold-word); }
.rail-hint { margin: 6px 6px 8px; font-size: 12px; color: var(--ink-2); }
.railbtn-add { width: 100%; margin-top: 8px; }

/* ---- the drawer: the question picked, as the customer's card and its settings ---- */
.qpanel-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 12px 10px 18px; border-bottom: 1px solid var(--line);
  font: 600 14px/1.2 var(--font); color: var(--ink); }
/* The ground under the card, as v3's: the card is a layer above it. */
.qpanel-card { background: var(--panel-2); padding: 16px; }
.frame-head { display: flex; align-items: center; justify-content: space-between; gap: 8px 12px; flex-wrap: wrap; max-width: 720px; margin: 0 auto 6px; font-size: 12px; color: var(--ink-2); }
.frame-switches { display: flex; gap: 8px; flex-wrap: wrap; }
.frame-hint { max-width: 720px; margin: 0 auto 12px; font-size: 12px; color: var(--ink-2); }
/* The frame: the one brand surface on the page, boxed so the boundary shows (v3; the card's own rules in card.css).
   Its corners are Kumii's, explicit, since inside the frame --radius is the brand's (Keune squares its corners). */
.frame { max-width: 720px; margin: 0 auto; border: 1px solid var(--line); border-radius: 16px; overflow: hidden; box-shadow: var(--b-pop); }
.frame-in { padding: 24px 20px 28px; }
.qpanel-card .frame .card { max-width: none; margin: 0; }
.qpanel-card .frame .nav, .qpanel-card .frame .counter, .qpanel-card .frame .fineprint { display: none; }
.frame-empty { max-width: 720px; margin: 0 auto; padding: 56px 24px; text-align: center; color: var(--ink-2); border: 1px dashed color-mix(in srgb, var(--ink) 25%, transparent); border-radius: 16px; }
/* Typing on the card: Kumii's focus, not the brand's (the caret is the builder's, the words the customer's). */
.qpanel-card [contenteditable] { outline: none; border-radius: 4px; }
.qpanel-card [contenteditable]:hover { box-shadow: inset 0 -1px 0 currentColor; }
.qpanel-card [contenteditable]:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; }
.qpanel-card [contenteditable][data-empty="true"]::before { content: attr(data-placeholder); opacity: .4; pointer-events: none; }
.qpanel-insp { padding: 4px 18px 18px; }
/* The settings under the card, in Settings' manner: sentence-case heads, a line between groups, the switches v5's. */
.insp-sec { padding: 14px 0; border-bottom: 1px solid var(--line); }
.insp-sec:last-child { border-bottom: 0; }
.insp-h { margin-bottom: 8px; font: 600 13px/1.2 var(--font); color: var(--gold-word); }
.insp-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 6px 0; }
.insp-hint { margin: 4px 0 0; font-size: 12px; color: var(--ink-2); }
.insp-note { margin-top: 10px; padding: 9px 11px; border-left: 3px solid var(--warn); background: var(--panel-2); border-radius: 0 8px 8px 0; font-size: 12.5px; }
select.ctl, input.ctl { width: 100%; min-height: 36px; padding: 7px 10px; border: 1px solid color-mix(in srgb, var(--ink) 18%, transparent); border-radius: var(--radius-btn);
  background: var(--panel); color: var(--ink); font: 500 13.5px/1.2 var(--font); }
.tog { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; }
.tog input[type="checkbox"] { accent-color: var(--btn-bg); }
/* v3's switch, built on the real checkbox (keyboard and screen readers untouched), drawn as Settings' on/off switch:
   the track, the knob, the main key's colour when on (ink in light, gold in dark). */
.insp-row input[type="checkbox"] { appearance: none; flex: none; width: 38px; height: 22px; margin: 0; border-radius: 999px; background: var(--chip-track);
  border: 1px solid var(--line); position: relative; cursor: pointer; transition: background-color .15s ease; }
.insp-row input[type="checkbox"]::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: var(--ink-2); transition: left .15s ease; }
.insp-row input[type="checkbox"]:checked { background: var(--btn-bg); border-color: var(--btn-bg); }
.insp-row input[type="checkbox"]:checked::after { left: 18px; background: var(--btn-ink); }
.optrow { display: grid; grid-template-columns: 1fr auto; gap: 6px; align-items: center; margin-bottom: 6px; }
.rulerow { display: flex; align-items: center; gap: 6px; padding: 6px 10px; margin-bottom: 6px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel-2); font-size: 12.5px; }
.rulerow .mono { color: var(--ink-2); }

/* ---- the workflow canvas (js/builder/graph.js) ---- */
/* The ground: the page itself shows through (the canvas colour, its lift in dark; no stone and no waves here, round
   32), and a grey dotted grid moves and scales with the cards, so a pan reads as the canvas moving. The dots are
   structure, not material, so Material off keeps them. */
.graph-viewport { position: relative; overflow: hidden; min-height: 0; cursor: grab; touch-action: none; user-select: none; --gx: 0px; --gy: 0px; --gk: 1;
  background-image: radial-gradient(circle at center, var(--b-dot) 0 1.1px, transparent 1.6px);
  background-size: calc(24px * var(--gk)) calc(24px * var(--gk)); background-position: var(--gx) var(--gy); }
.graph-viewport.is-panning { cursor: grabbing; }
.graph { position: absolute; left: 0; top: 0; width: 0; height: 0; will-change: transform; }
/* The direct child only (v3): chips, ports and the toolbar carry inline icons of their own. */
.graph > svg { position: absolute; left: 0; top: 0; overflow: visible; pointer-events: none; }
.wire { fill: none; stroke: var(--b-wire); stroke-width: 1.25; }
.wire--pending { stroke: var(--focus); stroke-width: 2; stroke-dasharray: 5 5; }

/* A card. Fixed heights (graph.js NODE_H) rest on these numbers: 12 and 14 of padding, a 1 px edge, 6 between rows, a
   22 px chip, a label of three 16 px lines, the line height 1.5 (v5's body is 1.45, so it is set here). Change one and
   the check (every card's content inside its box) says which card overflows. */
.node { position: absolute; display: grid; align-content: start; gap: 6px; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius-2);
  background: var(--panel); box-shadow: var(--card-shadow); color: var(--ink); text-align: left; cursor: grab; touch-action: none; user-select: none;
  font: 14px/1.5 var(--font); transition: box-shadow .15s ease, border-color .15s ease, background-color .24s ease; }
.node:active { cursor: grabbing; }
.node:hover { box-shadow: var(--b-lift); }
/* pointer-events:none while moving, so elementFromPoint sees the card UNDER it: that is how a drop reorders (v3). */
.node.is-moving { box-shadow: var(--b-pop); z-index: 3; pointer-events: none; opacity: .94; }
.node.is-droptarget { border-color: var(--focus); box-shadow: 0 0 0 3px color-mix(in srgb, var(--focus) 16%, transparent); }
.node.is-insert-before::before, .node.is-insert-after::after { content: ""; position: absolute; top: 6px; bottom: 6px; width: 3px; border-radius: 2px; background: var(--focus); }
.node.is-insert-before::before { left: -14px; }
.node.is-insert-after::after { right: -14px; }
/* The picked question: the edge in the deep gold, and the light from underneath (frame.css .edge), from its own slot
   so the card's ::before and ::after stay the insertion bars. The halo's z-index lets it lie under the card and the
   routes alike (the world, .graph, is the stacking context). Glass and glow off: the gold edge alone, as on every page. */
.node[aria-current="true"] { border-color: var(--gold-word); }
.node-light { display: none; position: absolute; left: 0; right: 0; bottom: 0; height: 0; pointer-events: none; }
:root:not([data-glass="off"]) .node[aria-current="true"]:not(.is-moving) .node-light { display: block; }
.node-light::after { content: ""; position: absolute; left: 14%; right: 14%; bottom: -1px; height: 2px; border-radius: 1px;
  background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--seam) 90%, transparent) 50%, transparent); }
.node-light::before { content: ""; position: absolute; left: 8%; right: 8%; bottom: -20px; height: 30px; z-index: -1; opacity: var(--halo);
  background: radial-gradient(50% 50% at 50% 30%, var(--seam), transparent 72%); filter: blur(9px); }
/* The picked card's connector takes the light. In the vertical flow it sits on the bottom edge's middle, where the
   light is brightest, and an ink disc there hid it; lit, the light runs out along the routes the question starts.
   Ink on the gold, 9:1. Not on a free-text card's grey connector, which starts no route. */
:root:not([data-glass="off"]) .node[aria-current="true"] .port:not(.port--off) { background: var(--gold); color: #16181C;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--gold) 28%, var(--canvas)), 0 0 18px 3px color-mix(in srgb, var(--seam) 50%, transparent); }
/* The type chip: the icon carries the type (v3), a small tile like the dashboard's card tiles; the picked question's
   in the rail's gold. */
.nchip { display: inline-flex; align-items: center; gap: 5px; height: 22px; width: max-content; padding: 0 7px 0 5px; border-radius: 6px;
  background: var(--panel-2); color: var(--ink); font: 500 12px/1 var(--font); }
.nchip svg { display: block; }
.node[aria-current="true"] .nchip { background: color-mix(in srgb, var(--gold) 16%, transparent); color: var(--gold-word); }
.node-label { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; font-size: 13px; line-height: 16px; font-weight: 500; color: var(--ink); }
.npre { display: grid; gap: 1px; font-size: 12px; line-height: 15px; color: var(--ink-2); }
.npre-line { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.npre--scale { display: flex; flex-wrap: wrap; gap: 2px; }
.npre--scale i { font-style: normal; font-size: 9px; width: 13px; height: 13px; display: grid; place-items: center; border-radius: 3px; background: var(--panel-2); }
/* The start card: what the link carries; dashed, Typeform's "Pull data in". Its three soft spots pinned (v3), so its
   height can be a constant: the icon's text strut, the hint clamped to six lines, one parameter per row. */
.node--start { border: 1px dashed color-mix(in srgb, var(--ink) 28%, transparent); background: transparent; box-shadow: none; }
.node--start:hover { box-shadow: none; }
.node-start-icon { color: var(--ink); }
.node-start-icon svg { display: block; }
.node-title { font-size: 14px; font-weight: 600; color: var(--ink); }
.node-hint { display: -webkit-box; -webkit-line-clamp: 6; -webkit-box-orient: vertical; overflow: hidden; font-size: 12px; line-height: 15px; color: var(--ink-2); }
.node-params { display: grid; justify-items: start; gap: 4px; margin-top: 2px; }
.nparam { font: 11px/16px var(--b-mono); max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding: 2px 6px; border-radius: 5px;
  border: 1px solid var(--line); color: var(--ink-2); background: var(--panel); }
.node--end .node-label { color: var(--ink); }
/* The connector: v3's ink circle on the route's origin, ink in every theme (near black in light, near white in dark):
   it is on every card, so it takes no gold. A ring of the canvas lifts it off the line it sits on. */
.port { position: absolute; right: -12px; top: 28px; z-index: 2; width: 24px; height: 24px; padding: 0; display: grid; place-items: center; border: 0; border-radius: 50%;
  background: var(--ink); color: var(--panel); box-shadow: 0 0 0 3px var(--canvas); cursor: pointer; touch-action: none; }
.port svg { display: block; }
.port:hover { box-shadow: 0 0 0 3px color-mix(in srgb, var(--ink) 22%, var(--canvas)); }
.port--off { background: var(--ink-3); }
.port.is-dragging { width: 14px; height: 14px; right: -7px; top: 33px; }
.port.is-dragging svg { display: none; }
/* The toolbar under a hovered or focused card (v3: the outer span pads the gap, so the pointer never leaves the card). */
.ntools { position: absolute; left: 0; top: 100%; z-index: 4; padding-top: 8px; opacity: 0; visibility: hidden; transition: opacity .12s, visibility 0s linear .3s; }
.ntools-in { display: flex; gap: 2px; padding: 4px; border-radius: 12px; background: var(--panel); border: 1px solid var(--line); box-shadow: var(--b-pop); }
.node:hover .ntools, .node:focus-within .ntools, .node.is-droptarget .ntools { opacity: 1; visibility: visible; transition-delay: 0s; }
.node.is-moving .ntools { visibility: hidden; opacity: 0; }
.ntool { width: 32px; height: 32px; padding: 0; border: 0; border-radius: 8px; display: grid; place-items: center; background: transparent; color: var(--ink-2); cursor: pointer; }
.ntool:hover { background: var(--panel-2); color: var(--ink); }
/* A rule on its line: a small tile with the sliders, a button (Tab reaches it, Enter edits). No square of ground
   round it any more: over the dotted ground a solid patch read as a hole, and the tile hides the joint itself. */
.rchip { position: absolute; z-index: 2; width: 32px; height: 32px; padding: 4px; border: 0; border-radius: 10px; background: transparent; cursor: pointer; }
.rchip > span { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 8px; background: var(--panel); color: var(--ink-2); border: 1px solid var(--line); box-shadow: var(--card-shadow); }
.rchip:hover > span, .rchip:focus-visible > span { border-color: var(--ink-3); color: var(--ink); }
/* The rule's popover: If … then go to … / Delete, Edit. */
.rpop { position: absolute; z-index: 5; width: 300px; padding: 14px 16px 12px; border-radius: 12px; background: var(--panel); border: 1px solid var(--line);
  box-shadow: var(--b-pop); font-size: 13px; color: var(--ink-2); cursor: default; }
.rpop-row { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.rpop-row--op b { color: var(--ink); font-weight: 500; }
.rpop-k { color: var(--ink); font-weight: 600; min-width: 30px; }
.rpop-k--soft { color: var(--ink-2); font-weight: 400; min-width: 48px; }
.rpop-q { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink); }
.rpop-join { margin: 2px 0 8px 38px; font-size: 12px; font-weight: 600; color: var(--ink-2); }
.rpop-then { border-top: 1px solid var(--line); margin: 4px 0 10px; padding-top: 10px; }
.rpop-f { display: flex; justify-content: space-between; align-items: center; margin-top: 12px; }
.rpop-del, .ldel, .brule-del { color: var(--warn); }
.rpop-del svg, .ldel svg, .brule-del svg { display: inline-block; vertical-align: -2px; }

/* ---- the vertical flow (graph.js sets .is-vertical): the connector on the bottom edge, the toolbar beside (v3) ---- */
.graph.is-vertical .port { right: auto; top: auto; left: calc(50% - 12px); bottom: -12px; }
.graph.is-vertical .port.is-dragging { left: calc(50% - 7px); bottom: -7px; }
.graph.is-vertical .ntools { left: 100%; top: 0; padding: 0 0 0 8px; }
.graph.is-vertical .ntools-in { flex-direction: column; }
.graph.is-vertical .node.is-insert-before::before, .graph.is-vertical .node.is-insert-after::after { left: 6px; right: 6px; width: auto; height: 3px; }
.graph.is-vertical .node.is-insert-before::before { top: -14px; bottom: auto; }
.graph.is-vertical .node.is-insert-after::after { top: auto; bottom: -14px; }

/* ---- the bars over the canvas: zoom (bottom left), ask (bottom centre) ---- */
.graph-ctl, .graph-ai { border: 1px solid var(--line); background: var(--bar-glass); box-shadow: var(--b-pop); }
.graph-ctl { position: absolute; left: 16px; bottom: 16px; z-index: 3; display: flex; align-items: center; gap: 2px; padding: 4px; border-radius: 12px; }
.graph-ctl .bbtn--icon { width: 32px; min-height: 32px; border-color: transparent; color: var(--ink-2); }
.graph-ctl .bbtn--icon:hover { color: var(--ink); }
.graph-ctl .bbtn--icon[aria-pressed="true"] { background: var(--chip-on); color: var(--chip-on-ink); box-shadow: var(--chip-on-shadow); }
:root[data-theme="dark"] .graph-ctl .bbtn--icon[aria-pressed="true"] { background: var(--chip-on-hi); }
.graph-ctl-sep { width: 1px; height: 18px; background: var(--line); margin: 0 3px; }
/* Typeform's "Chat to create", shown and marked Not wired (v3). Centred where there is room, else right of the zoom bar. */
.graph-ai { position: absolute; bottom: 18px; z-index: 3; left: max(calc(50% - 260px), 280px); width: min(520px, calc(100% - 296px));
  display: flex; align-items: center; gap: 6px; margin: 0; padding: 6px 6px 6px 8px; border-radius: 16px; }
@container flow (max-width: 640px) { .graph-ai { left: 16px; right: 16px; width: auto; bottom: 72px; } }
.graph-ai input { flex: 1; min-width: 0; padding: 8px 4px; border: 0; background: transparent; font: 14px/1.2 var(--font); color: var(--ink); }
.graph-ai input:focus-visible { outline: none; }
.graph-ai:focus-within { border-color: color-mix(in srgb, var(--focus) 60%, transparent); }
.graph-ai input::placeholder { color: var(--ink-2); }
.graph-ai .ntool--send { border-radius: 50%; background: var(--btn-bg); color: var(--btn-ink); }
.graph-ai .ntool--send:hover { background: var(--btn-bg); box-shadow: inset 0 0 0 99px rgba(255, 255, 255, .08); }
/* ---- the preview's status bar: what Save does here (round 31 held the look switch beside it, gone since round 32) ---- */
.bfoot { display: flex; align-items: center; gap: 6px 16px; flex-wrap: wrap; padding: 8px 16px 8px 14px;
  border-top: 1px solid var(--line); background: var(--panel); font-size: 12px; color: var(--ink-2); }
.bfoot-note { margin: 0; }

/* ---- the two boundaries (js/builder/splitters.js): the line on hover, focus and drag is the focus ring here (v3) ---- */
.split { position: absolute; top: 0; bottom: 0; z-index: 6; width: 8px; cursor: col-resize; touch-action: none; user-select: none; }
.split::before { content: ""; position: absolute; top: 0; bottom: 0; left: 3px; width: 2px; background: var(--ink-3); opacity: 0; transition: opacity .12s; }
.split:hover::before { opacity: 1; }
.split:focus-visible::before, .split.is-dragging::before { opacity: 1; background: var(--focus); }
.split:focus-visible { outline: none; box-shadow: none; }
.split--l { left: calc(var(--rail-w) - 4px); }
.split--r { right: calc(var(--panel-w) - 4px); }
.view--one:not(.has-panel) .split--r { display: none; }
.view--one.is-splitting { user-select: none; cursor: col-resize; }
.view--one.is-splitting .graph-viewport { cursor: col-resize; }
.view--one.rail-collapsed { --rail-w: 0px; }
.view--one.rail-collapsed .pane--rail { display: none; }
.view--one.rail-collapsed .split--l { left: 0; width: 14px; background: var(--panel); border-right: 1px solid var(--line); }
.view--one.rail-collapsed .split--l::before { display: none; }
.split-tab { display: none; position: absolute; top: 50%; left: 1px; transform: translateY(-50%) rotate(-90deg); color: var(--ink-2); }
.split-tab svg { display: block; }
.view--one.rail-collapsed .split-tab { display: block; }
.view--one.rail-collapsed .split--l:hover .split-tab, .view--one.rail-collapsed .split--l:focus-visible .split-tab { color: var(--ink); }

/* ---- the dialogs: one host (js/builder/dialog.js), drawn as v5's Settings ---- */
.modal-host { position: fixed; inset: 0; z-index: 40; display: grid; place-items: center; padding: 24px; background: rgba(8, 12, 20, .55); }
:root[data-glass="on"] .modal-host { -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
.modal { width: min(880px, 100%); max-height: calc(86vh / var(--zoom, 1)); display: grid; grid-template-rows: auto 1fr auto; overflow: hidden;
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); color: var(--ink); box-shadow: 0 24px 60px rgba(0, 0, 0, .35); }
/* Larger text: the dialog is outside the shell, so it is zoomed itself, as Settings is (frame.css). */
:root[data-text="large"] .modal-host > .modal { zoom: var(--zoom); }
.modal--narrow { width: min(600px, 100%); }
.modal-h { position: relative; padding: 18px 20px 12px; border-bottom: 1px solid var(--line); }
.modal-h h2 { margin: 0 0 4px; font: 600 18px/1.25 var(--font); }
.modal-lead { margin: 0; font-size: 13px; color: var(--ink-2); max-width: 62ch; }
.modal-b { padding: 20px; overflow: auto; }
.modal-b > p { margin: 0; max-width: 64ch; }
.modal-f { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 20px; border-top: 1px solid var(--line); }
.modal-x { position: absolute; right: 14px; top: 14px; }
/* The block picker: the four types, two of them named (the NPS question; NOT an NPS input), the measurement rule's
   whole point (v3). The NPS line in the deep gold, the faces' warning in the orange, each 4.5:1 on the panel. */
.bgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.bcard { display: grid; gap: 3px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); color: var(--ink); cursor: pointer; text-align: left;
  font: inherit; transition: border-color .15s ease, background-color .15s ease; }
.bcard:hover { border-color: var(--ink-3); background: var(--panel-2); }
.bcard b { font-weight: 600; }
.bcard span { font-size: 12px; color: var(--ink-2); }
.bcard--nps span { color: var(--gold-word); font-weight: 500; }
.bcard--faces span { color: var(--warn); font-weight: 500; }
/* Translations: every question, every language. */
.tgrid { width: 100%; border-collapse: collapse; font-size: 13px; }
.tgrid th, .tgrid td { padding: 9px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.tgrid th { font: 600 12px/1.2 var(--font); color: var(--ink-2); }
.tgrid td.is-missing { color: var(--warn); font-style: italic; }
/* The Logic modal (js/builder/logic.js): the questions on the left, the picked one's four sections on the right. */
.modal--logic { width: min(1120px, 100%); height: min(calc(86vh / var(--zoom, 1)), 760px); }
.lbody { display: grid; grid-template-columns: 300px 1fr; padding: 0; overflow: hidden; }
.llist { overflow: auto; padding: 14px 12px; border-right: 1px solid var(--line); background: var(--panel-2); }
.lq { display: grid; grid-template-columns: auto 1fr; gap: 4px 10px; align-items: center; width: 100%; padding: 10px 12px; margin-bottom: 2px; border: 0; border-radius: 10px;
  background: transparent; color: var(--ink); text-align: left; cursor: pointer; font: inherit; }
.lq:hover { background: var(--nav-hover); }
.lq.is-selected { background: color-mix(in srgb, var(--gold) 13%, transparent); color: var(--nav-on); }
.lq--start { cursor: default; color: var(--ink-2); }
.lq--start:hover { background: transparent; }
.lq-text { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lq-hint { grid-column: 2; font-size: 11.5px; color: var(--ink-2); white-space: normal; }
.lq-count { grid-column: 2; width: max-content; padding: 2px 8px; border-radius: 999px; background: var(--panel); border: 1px solid var(--line); font-size: 11.5px; color: var(--ink-2); }
.lpane { overflow: auto; padding: 22px 26px; background: var(--panel); }
.lpane-h { display: flex; align-items: center; gap: 10px; margin-bottom: 18px; font-size: 14px; }
.lpane-q { color: var(--ink); font-weight: 500; }
.lsec { border: 1px solid var(--line); border-radius: 12px; margin-bottom: 12px; overflow: hidden; }
.lsec-h { display: flex; align-items: center; gap: 10px; width: 100%; padding: 13px 16px; border: 0; background: var(--panel); color: var(--ink); cursor: pointer; text-align: left;
  font: 600 14px/1.2 var(--font); }
.lsec.is-open .lsec-h { background: var(--panel-2); }
.lsec-i { display: inline-flex; color: var(--ink-2); }
.lsec-h .lq-count { grid-column: auto; }
.lsec-chev { margin-left: auto; display: inline-flex; color: var(--ink-2); transition: transform .12s; }
.lsec.is-open .lsec-chev { transform: rotate(180deg); }
.lsec-b { padding: 16px 16px 18px; }
.lsec-empty { display: flex; align-items: center; gap: 6px; margin: 0 0 12px; font-size: 13px; color: var(--ink-2); }
.lsec-empty svg { display: inline-block; }
.lsec-nw { margin: 0 0 12px; padding: 10px 12px; border-left: 3px solid var(--ink-3); background: var(--panel-2); font-size: 12.5px; color: var(--ink-2); }
.modal-f--split { justify-content: space-between; align-items: center; }
.lfoot-r { display: flex; align-items: center; gap: 8px; }
.lerr { font-size: 12.5px; color: var(--warn); max-width: 46ch; }
/* One branching rule: Go to / When [q] [op] [value] / + Add condition (and, or) / Delete rule (v3, Typeform's order). */
.brule { padding: 14px 16px; margin-bottom: 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); }
.crow { display: grid; grid-template-columns: 76px 1.7fr 1.1fr .9fr 34px; gap: 8px; align-items: center; margin-bottom: 8px; }
.crow--goto { grid-template-columns: 76px 1fr; padding-bottom: 12px; margin-bottom: 12px; border-bottom: 1px solid var(--line); }
.crow--acts { display: flex; justify-content: space-between; margin: 4px 0 0; }
.crow-k { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; font-size: 13px; color: var(--ink); }
.crow-k svg { display: inline-block; }
.ctl--join { width: max-content; }
.branch-default { display: flex; gap: 8px; align-items: baseline; padding: 12px 14px; margin: 4px 0 12px; border: 1px dashed color-mix(in srgb, var(--ink) 25%, transparent); border-radius: 10px;
  color: var(--ink-2); font-size: 13px; }

/* ---- the Material setting on the builder's parts ---- */
/* Cards take the dashboard's three materials (panels.css): Off paper, Flat see-through in dark with a line of light,
   Tactile with depth; glass off keeps them solid. The start card stays an outline in every material. */
:root:not([data-glass="off"]):is([data-material="flat"], [data-material="tactile"]) .node:not(.node--start) { background: var(--panel-glass); }
:root[data-material="flat"] .node:not(.node--start) { box-shadow: var(--rim); }
:root[data-material="tactile"] .node:not(.node--start) { box-shadow: var(--depth); }
:root[data-theme="dark"][data-material="tactile"] .node:not(.node--start) { background-image: linear-gradient(180deg, rgba(255, 255, 255, .05), rgba(255, 255, 255, 0) 50%); }
:root[data-material="tactile"] .node:not(.node--start):hover { box-shadow: var(--depth), var(--b-lift); }
/* Tactile's keys (frame.css: the settings' Close key, the track's raised choice). */
:root[data-material="tactile"] .bseg { background: var(--panel-2); box-shadow: inset 0 1px 2px rgba(0, 0, 0, .18), inset 0 -1px 0 rgba(255, 255, 255, .05); }
:root[data-material="tactile"] .bseg button[aria-pressed="true"] { position: relative; background: linear-gradient(180deg, var(--chip-on-hi), var(--chip-on));
  box-shadow: 0 1px 2px rgba(0, 0, 0, .28), inset 0 1px 0 rgba(255, 255, 255, .14); }
:root[data-material="tactile"] .bseg button[aria-pressed="true"]::after { content: ""; position: absolute; left: 28%; right: 28%; bottom: 2px; height: 2px; border-radius: 1px;
  background: var(--seam); box-shadow: 0 0 6px var(--seam); }
:root[data-glass="off"][data-material="tactile"] .bseg button[aria-pressed="true"]::after { box-shadow: none; }
:root[data-material="tactile"] .bbtn:not(.bbtn--primary):not(.bbtn--ghost):not(:disabled) { background: linear-gradient(180deg, var(--chip-on-hi), var(--chip-on));
  box-shadow: 0 1px 2px rgba(0, 0, 0, .22), inset 0 1px 0 rgba(255, 255, 255, .14); }
:root[data-material="tactile"] .graph-ctl .bbtn--icon:not([aria-pressed="true"]) { background: transparent; box-shadow: none; }
:root[data-material="tactile"] .bbtn--primary { box-shadow: 0 1px 2px rgba(0, 0, 0, .3), inset 0 1px 0 rgba(255, 255, 255, .22); }
:root[data-material="tactile"] .insp-row input[type="checkbox"] { background: var(--knob-groove); border-color: transparent;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, .32), inset 0 -1px 0 rgba(255, 255, 255, .06); }
:root[data-material="tactile"] .insp-row input[type="checkbox"]::after { background: linear-gradient(180deg, var(--knob-hi), var(--knob-lo));
  box-shadow: 0 0 0 1px var(--knob-ring), 0 1px 2px rgba(0, 0, 0, .35), 0 2px 5px rgba(0, 0, 0, .18); }
:root[data-material="tactile"] .insp-row input[type="checkbox"]:checked { background: linear-gradient(180deg, color-mix(in srgb, var(--btn-bg) 78%, #000), var(--btn-bg)); }
:root[data-material="tactile"] .insp-row input[type="checkbox"]:checked::after { background: linear-gradient(180deg, #FFFFFF, #ECEEF1); }
:root[data-material="tactile"] :is(.nchip, .qnum) { background: var(--tile-face); box-shadow: var(--tile-depth); border-color: transparent; }
:root[data-material="tactile"] .node[aria-current="true"] .nchip,
:root[data-material="tactile"] .qrow[aria-current="true"] .qnum { background: color-mix(in srgb, var(--gold) 16%, transparent); box-shadow: none; }

/* ---- v5's glass and light on the builder's parts: the full look (Rob, 23 Oct: "I think we keep v5 full and they can
   just adjust in the settings. looks so good!"). Glass: the header band, as the dashboard's; the bars over the
   canvas, the sticky filter bar's near-solid glass, since the canvas moves under them; the two side panels, as the
   sidebar. Light: the picked question's routes in gold, the ask bar's lit gold rim, and Save, the main key, lit from
   underneath (the waves and the stone are out of this page, above). Glass and glow off takes the glass and the
   lights, and More contrast the glows, as on every page.
   The routes stay gold with Glass and glow off: a colour, as the page you are on keeps its gold pill. ---- */
:root:not([data-glass="off"]) :is(.graph-ctl, .graph-ai) { -webkit-backdrop-filter: blur(var(--glass-blur)); backdrop-filter: blur(var(--glass-blur)); box-shadow: var(--glass-rim), var(--b-pop); }
:root[data-glass="off"] :is(.graph-ctl, .graph-ai) { background: var(--panel); }
:root:not([data-glass="off"]) :is(.pane--rail, .pane--qpanel) { background: var(--side-glass); -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(140%);
  backdrop-filter: blur(var(--glass-blur)) saturate(140%); box-shadow: var(--glass-rim); }
:root:not([data-glass="off"]) .qpanel-card { background: color-mix(in srgb, var(--panel-2) 55%, transparent); }
:root:not([data-glass="off"]) :is(.notice, .bfoot) { background: var(--bar-glass); }
.wire--lit { stroke: var(--gold-word); stroke-width: 1.75; }
:root:not([data-glass="off"]):not([data-contrast="more"]) .wire--lit { filter: drop-shadow(0 0 3px color-mix(in srgb, var(--seam) 75%, transparent)); }
:root:not([data-glass="off"]) .graph-ai { box-shadow: 0 0 0 1px color-mix(in srgb, var(--gold) 55%, transparent), 0 10px 28px -10px color-mix(in srgb, var(--seam) 80%, transparent), var(--b-pop); }
:root:not([data-glass="off"]):not([data-contrast="more"]) .bbtn--primary { box-shadow: 0 8px 16px -8px color-mix(in srgb, var(--seam) 90%, transparent), inset 0 -2px 0 color-mix(in srgb, var(--seam) 70%, transparent); }

/* ---- forced colours (Windows high contrast): the light and the dots go; the cards keep an edge ---- */
@media (forced-colors: active) {
  .node-light, .wire--lit { display: none; filter: none; }
  .node { border: 1px solid CanvasText; }
  .node[aria-current="true"] { outline: 2px solid Highlight; outline-offset: 2px; }
  .qrow[aria-current="true"] { outline: 2px solid Highlight; outline-offset: -2px; }
  .graph-viewport { background-image: none !important; }
}

/* ---- narrow: below 900 px the three panes stack (v3's breakpoint, here only) ---- */
/* Each pane takes the one column and a row of its own: their columns are pinned for the wide grid, so they are
   re-pinned here, or the grid grows implicit columns and the panes stand side by side again. */
@media (max-width: 900px) {
  body[data-page="builder"] .page { height: auto; }
  .builder { grid-template-rows: auto auto auto auto; }
  .view { overflow: visible; }
  .view--one, .view--one.has-panel { grid-template-columns: minmax(0, 1fr); }
  .pane--rail { grid-column: 1; grid-row: 1; border-right: 0; border-bottom: 1px solid var(--line); }
  .flow { grid-column: 1; grid-row: 2; min-height: 60vh; grid-template-rows: minmax(60vh, 1fr) auto auto; }
  .pane--qpanel { grid-column: 1; grid-row: 3; border-left: 0; border-top: 1px solid var(--line); }
  .split { display: none; }
  .view--one.rail-collapsed .pane--rail { display: block; }
  .graph-ctl, .graph-ai { position: static; }
  .graph-ctl { margin: 12px 16px 0; width: max-content; }
  .graph-ai { width: auto; margin: 12px 16px; }
  .lbody { grid-template-columns: 1fr; }
  .llist { max-height: 30vh; border-right: 0; border-bottom: 1px solid var(--line); }
  .crow { grid-template-columns: 1fr 1fr; }
  .crow--goto { grid-template-columns: 1fr; }
}
/* On a phone the sidebar is the bar at the screen's foot (frame.css, round 27): the page keeps clear of it. */
@media (max-width: 767px) {
  body[data-page="builder"] .page { padding-bottom: calc(72px + env(safe-area-inset-bottom, 0px)); }
  .bhead { padding: 14px 16px; }
  .notice { padding: 9px 16px; }
  .btitle { font-size: 20px; }
}
