/* editor/jutsu-workspace.css
   The Jutsu workspace: the arena fills the window and the interface floats on it as glass panels:
   a top bar, a flow strip along the bottom, an inspector beside the selected card, and popovers.
   Design: docs/JUTSU_COMPOSITION_DESIGN.md, section 13.12. */

/* the section it replaces is emptied; the workspace itself is a child of <body> */
#section-jutsu.jw-on { padding: 0; }
#section-jutsu.jw-on > .list-panel,
#section-jutsu.jw-on > #jutsu-editor { display: none; }

/* the game's damage-number font, so a hit in the preview reads as it does in the game */
@font-face { font-family: 'Upheaval'; src: url('/fonts/upheavtt.ttf') format('truetype'); font-display: swap; }

.jw {
  --text: #e8eef7; --dim: #93a1b5; --faint: #5d6a7d; --line: rgba(255, 255, 255, .1); --line2: rgba(255, 255, 255, .18);
  --glass: rgba(11, 15, 23, .66); --glass2: rgba(20, 26, 38, .72); --field: rgba(4, 7, 12, .55);
  --accent: #5cc8ff; --good: #4ade80; --warn: #fbbf24; --bad: #ff6b6b;
  /* the open technique's element colours the accents; set on the root by the script */
  --el: #9fb3c8; --el-soft: rgba(159, 179, 200, .18);
  --flow: #9aa7ba; --gameplay: #ff7b72; --movement: #c79bff; --animation: #6fb1ff; --vfx: #3ddc97; --audio: #ffcf5c; --camera: #ff8fc7;
  position: fixed; inset: 0; z-index: 3000; overflow: hidden;
  background: #0d1017; color: var(--text); font: 13px/1.4 "Segoe UI", system-ui, -apple-system, sans-serif;
  user-select: none; -webkit-user-select: none;
}
.jw * { box-sizing: border-box; }
.jw input, .jw textarea, .jw select { user-select: text; -webkit-user-select: text; }

/* ── the arena ── */
.jw-view { position: absolute; inset: 0; }
.jw-view canvas { width: 100%; height: 100%; display: block; outline: none; touch-action: none; }
/* a soft vignette so the floating panels read against a bright sky; it never takes a click */
.jw-view::after { content: ''; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(to bottom, rgba(4, 6, 10, .42), rgba(4, 6, 10, 0) 90px), linear-gradient(to top, rgba(4, 6, 10, .5), rgba(4, 6, 10, 0) 220px); }

.jw-glass {
  background: var(--glass); border: 1px solid var(--line); border-radius: 12px;
  -webkit-backdrop-filter: blur(14px) saturate(1.25); backdrop-filter: blur(14px) saturate(1.25);
  box-shadow: 0 10px 34px rgba(0, 0, 0, .42), inset 0 1px 0 rgba(255, 255, 255, .05);
}

/* ── buttons and fields ── */
.jw button { display: inline-flex; align-items: center; gap: 6px; font: inherit; color: var(--text); background: rgba(255, 255, 255, .06); border: 1px solid var(--line); border-radius: 7px; padding: 4px 10px; cursor: pointer; transition: background .12s, border-color .12s, color .12s, box-shadow .12s; }
.jw button:hover:not(:disabled) { background: rgba(255, 255, 255, .12); border-color: var(--line2); }
.jw button:disabled { opacity: .38; cursor: not-allowed; }
.jw button.primary { background: var(--el-soft); border-color: var(--el); color: #f1ead8; font-weight: 600; }
.jw button.on { background: var(--el-soft); border-color: var(--el); }
.jw button.ghost { background: transparent; border-color: transparent; padding: 2px 6px; color: var(--dim); }
.jw button.ghost:hover:not(:disabled) { color: var(--text); border-color: var(--line); background: rgba(255, 255, 255, .06); }
.jw button.icon { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; padding: 0; border-radius: 8px; }
.jw button.icon svg, .jw button svg { display: block; fill: currentColor; flex: none; }
.jw input, .jw select, .jw textarea {
  font: inherit; color: var(--text); background: var(--field); border: 1px solid var(--line); border-radius: 6px; padding: 4px 7px; min-width: 0;
}
.jw select option { background: #0d1017; color: var(--text); }
.jw input:focus, .jw select:focus, .jw textarea:focus { outline: none; border-color: var(--el); box-shadow: 0 0 0 2px var(--el-soft); }
.jw input[type=checkbox] { width: 14px; height: 14px; padding: 0; accent-color: var(--el); }
.jw input[type=color] { padding: 0; width: 34px; height: 24px; }
.jw ::-webkit-scrollbar { width: 9px; height: 9px; }
.jw ::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, .16); border-radius: 5px; border: 2px solid transparent; background-clip: padding-box; }
.jw ::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, .3); background-clip: padding-box; border: 2px solid transparent; }
.jw ::-webkit-scrollbar-corner { background: transparent; }

/* ── top bar ── */
.jw-top { position: absolute; left: 12px; right: 12px; top: 10px; height: 46px; display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 12px; padding: 0 8px; z-index: 6; }
.jw-top .grp { display: flex; align-items: center; gap: 6px; min-width: 0; }
.jw-top .grp.r { justify-content: flex-end; }
.jw-top .sep { width: 1px; height: 22px; background: var(--line); margin: 0 4px; flex: none; }
.jw-back { color: var(--dim); white-space: nowrap; display: inline-flex; align-items: center; gap: 2px; padding: 4px 8px 4px 2px !important; }
.jw-name { display: inline-flex; align-items: center; gap: 8px; min-width: 0; padding: 3px 8px 3px 4px !important; border-radius: 9px !important; background: transparent !important; border-color: transparent !important; }
.jw-name:hover { background: rgba(255, 255, 255, .08) !important; border-color: var(--line) !important; }
.jw-name .ico { width: 30px; height: 30px; border-radius: 7px; overflow: hidden; flex: none; background: rgba(0, 0, 0, .4); box-shadow: 0 0 0 1px var(--el), 0 0 14px var(--el-soft); display: flex; align-items: center; justify-content: center; }
.jw-name .ico > * { transform: scale(.75); transform-origin: center; flex: none; }
.jw-name .nm { font-weight: 700; font-size: 16px; letter-spacing: .01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-shadow: 0 0 18px var(--el-soft); }
.jw-name svg { color: var(--dim); }
.jw-chip { font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; padding: 2px 8px; border-radius: 10px; background: var(--el-soft); color: var(--el); white-space: nowrap; border: 1px solid transparent; }
.jw-chip.gap { background: rgba(255, 107, 107, .16); color: var(--bad); }
.jw-status { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--dim); white-space: nowrap; background: transparent !important; border-color: transparent !important; padding: 3px 8px !important; }
.jw-status:hover { border-color: var(--line) !important; }
.jw-status::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--good); box-shadow: 0 0 8px var(--good); }
.jw-status.dirty { color: var(--warn); } .jw-status.dirty::before { background: var(--warn); box-shadow: 0 0 8px var(--warn); }
.jw-status.bad { color: var(--bad); } .jw-status.bad::before { background: var(--bad); box-shadow: 0 0 8px var(--bad); }
.jw-top .play { width: 38px; height: 34px; color: #f1ead8; background: var(--el-soft); border-color: var(--el); box-shadow: 0 0 16px var(--el-soft); }
.jw-top .play:hover:not(:disabled) { background: var(--el-soft); box-shadow: 0 0 22px var(--el); }
.jw-speed { min-width: 44px; font-variant-numeric: tabular-nums; color: var(--dim); }
.jw-ctrl { white-space: nowrap; display: inline-flex; align-items: center; gap: 6px; color: #93ad86; background: rgba(46, 204, 113, .14) !important; border-color: rgba(46, 204, 113, .5) !important; }
.jw-ctrl:hover:not(:disabled) { background: rgba(46, 204, 113, .26) !important; }
.jw-save { padding: 5px 16px !important; }

/* Play as caster: the top bar steps back to a hint. The flow strip stays exactly as it is when
   watching (it used to shrink to one row, which made it unreadable); it only stops taking clicks. */
.jw-hint { position: absolute; left: 50%; top: 10px; transform: translateX(-50%); display: none; align-items: center; gap: 14px; padding: 7px 8px 7px 16px; font-size: 12px; color: var(--text); white-space: nowrap; z-index: 6; }
.jw-hint b { color: #93ad86; font-weight: 600; }
.jw-hint .keys { color: var(--dim); }
.jw.jw-play .jw-top, .jw.jw-play .jw-inspector, .jw.jw-play .jw-live, .jw.jw-play .jw-strip-tools { display: none !important; }
.jw.jw-play .jw-hint { display: flex; }
.jw.jw-play .jw-strip { pointer-events: none; }
.jw.jw-play .jw-view::after { display: none; }

/* ── the flow strip ── */
.jw-strip { position: absolute; left: 12px; right: 12px; bottom: 12px; max-height: min(38vh, 380px); display: flex; z-index: 5; }
.jw-flow { flex: 1; min-width: 0; overflow: auto; border-radius: 12px; overscroll-behavior: contain; transition: height .16s ease-out; }
.fl-canvas { position: relative; }
.fl-canvas svg.fl-wires { position: absolute; left: 0; top: 0; pointer-events: none; overflow: visible; }
.fl-wires path { fill: none; stroke: rgba(255, 255, 255, .26); stroke-width: 1.5; }
.fl-wires path.trunk { stroke: rgba(255, 255, 255, .2); }
.jw-strip-tools { position: absolute; right: 8px; top: -30px; display: flex; gap: 4px; }
.jw-strip-tools button { font-size: 11px; padding: 2px 9px; color: var(--dim); background: var(--glass); border-radius: 9px; -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }

.fl-card { position: absolute; height: 44px; min-width: 64px; max-width: 208px; padding: 5px 12px 5px 15px; display: flex; flex-direction: column; justify-content: center;
  background: var(--glass2); border: 1px solid var(--line); border-radius: 9px; cursor: pointer; white-space: nowrap;
  transition: border-color .12s, box-shadow .2s, background .12s, opacity .2s; --ln: var(--flow); }
.fl-card::before { content: ''; position: absolute; left: 5px; top: 8px; bottom: 8px; width: 3px; border-radius: 2px; background: var(--ln); box-shadow: 0 0 8px var(--ln); opacity: .9; }
.fl-card:hover { border-color: var(--line2); background: rgba(34, 42, 58, .82); }
.fl-card .t { font-weight: 600; font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; }
.fl-card .s { font-size: 10.5px; color: var(--dim); overflow: hidden; text-overflow: ellipsis; margin-top: -1px; }
.fl-card.sel { border-color: var(--el); box-shadow: 0 0 0 1px var(--el), 0 0 18px var(--el-soft); background: rgba(40, 50, 68, .9); }
.fl-card.off { opacity: .42; } .fl-card.off .t { text-decoration: line-through; }
.fl-card.bad { border-color: var(--bad); } .fl-card.bad::after, .fl-card.warn::after { content: '!'; position: absolute; right: -5px; top: -6px; width: 14px; height: 14px; border-radius: 50%; background: var(--bad); color: #c9745c; font: 700 10px/14px system-ui; text-align: center; }
.fl-card.warn::after { background: var(--warn); }
.fl-card.ln-gameplay { --ln: var(--gameplay); } .fl-card.ln-movement { --ln: var(--movement); } .fl-card.ln-animation { --ln: var(--animation); }
.fl-card.ln-vfx { --ln: var(--vfx); } .fl-card.ln-audio { --ln: var(--audio); } .fl-card.ln-camera { --ln: var(--camera); } .fl-card.ln-flow { --ln: var(--flow); }
/* the time a card starts at, when it is later than the card before it */
.fl-card .tm { position: absolute; left: 8px; top: -8px; font: 600 9.5px/13px ui-monospace, Consolas, monospace; padding: 0 5px; border-radius: 7px; background: #1a1e28; border: 1px solid var(--line2); color: #e2d3a6; }
.fl-card .fl-more { position: absolute; right: 2px; top: 2px; width: 18px; height: 16px; padding: 0; border: 0; background: transparent; color: var(--dim); border-radius: 5px; display: none; align-items: center; justify-content: center; }
.fl-card:hover .fl-more, .fl-card.sel .fl-more { display: flex; }
.fl-card .fl-more:hover { background: rgba(255, 255, 255, .16); color: #f1ead8; }
/* a sound card can be heard from the card itself: a small play button that is always there */
/* It stands BEFORE the words and is centred on them (the words are centred in the card's height). */
.fl-card.has-hear { padding-left: 42px; }
.fl-card .fl-hear { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); }
/* the same round play button wherever a sound can be heard: on a card, beside the sound's field, in the sound list */
.jw .jw-hear, .fl-card .fl-hear { width: 20px; height: 20px; padding: 0; border: 0; border-radius: 50%; flex: none; background: rgba(255, 255, 255, .14); color: #f1ead8; display: flex; align-items: center; justify-content: center; cursor: pointer; }
.jw .jw-hear:hover, .fl-card .fl-hear:hover { background: rgba(255, 255, 255, .3); }
.jw .jw-hear.on, .fl-card .fl-hear.on { background: var(--accent); color: #e2d3a6; }
.jw .jw-hear.missing, .fl-card .fl-hear.missing { opacity: .4; }
/* the sound list: search, then every sound with its play button in front */
.jw .jw-soundpick { flex: 1; min-width: 0; display: flex; align-items: center; gap: 6px; padding: 4px 8px; text-align: left; }
.jw .jw-soundpick .nm { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.jw .jw-soundpick.none .nm { color: var(--dim); }
.jw-picker.jw-sounds { width: 300px; max-height: 60vh; }
.jw-sounds .jw-item { gap: 8px; padding: 3px 6px; }
.jw-sounds .jw-item .nm { font-weight: 500; }

/* Cast and End: the two that are always there */
.fl-card.fl-cast, .fl-card.fl-end { --ln: var(--el); border-radius: 22px; padding: 5px 16px 5px 18px; }
.fl-card.fl-cast::before, .fl-card.fl-end::before { left: 8px; top: 50%; bottom: auto; width: 6px; height: 6px; margin-top: -3px; border-radius: 50%; }
.fl-card.fl-cast .t, .fl-card.fl-end .t { letter-spacing: .04em; }
.fl-card.fl-end { cursor: default; min-width: 0; }
/* a phase marker: how this phase ends */
.fl-card.fl-gate { --ln: var(--el); border-style: solid; background: linear-gradient(135deg, rgba(40, 50, 70, .9), rgba(22, 28, 40, .82)); padding-left: 30px; }
.fl-card.fl-gate::before { left: 10px; top: 50%; bottom: auto; width: 10px; height: 10px; margin-top: -5px; border-radius: 2px; transform: rotate(45deg); }
/* the same steps as a branch drawn elsewhere: one line of words that goes there on a click */
.fl-link { position: absolute; height: 20px; line-height: 18px; padding: 0 8px; font-size: 11px; color: var(--dim); white-space: nowrap; border: 1px dashed var(--line2); border-radius: 10px; cursor: pointer; max-width: 260px; overflow: hidden; text-overflow: ellipsis; }
.fl-link:hover { color: var(--text); border-color: var(--el); }
.fl-link.tall { margin-top: 12px; }
.fl-link.bad { color: var(--bad); border-color: var(--bad); }
/* where a way out of a phase leads */
.fl-dest { position: absolute; height: 44px; display: flex; align-items: center; font-size: 11px; color: var(--dim); white-space: nowrap; padding: 0 2px; }
.fl-dest b { color: var(--text); font-weight: 600; margin-left: 4px; }

/* the grip of a group of cards drawn in the line (a "Do steps" whose steps are used nowhere else) */
.fl-grip { position: absolute; width: 10px; height: 44px; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.fl-grip i { width: 4px; height: 24px; border-radius: 2px; background: repeating-linear-gradient(to bottom, rgba(255, 255, 255, .34) 0 3px, transparent 3px 6px); }
.fl-grip:hover i, .fl-grip.sel i { background: var(--el); box-shadow: 0 0 8px var(--el); }
.fl-grip.live i, .fl-grip.flash i { background: #1a1e28; box-shadow: 0 0 10px var(--el); }
.fl-grip.bad i { background: var(--bad); }
.fl-wires path.group { stroke: rgba(255, 255, 255, .2); stroke-dasharray: 2 3; }
/* the strip scrolls: a fade and an arrow at each edge there is more beyond */
.fl-fade { position: absolute; pointer-events: none; opacity: 0; transition: opacity .15s; z-index: 2; display: flex; align-items: center; color: #f1ead8; font: 600 20px/1 system-ui; text-shadow: 0 0 8px #000; }
.fl-fade.on { opacity: 1; }
.fl-fade.l { left: 0; top: 0; bottom: 0; width: 46px; padding-left: 5px; border-radius: 12px 0 0 12px; background: linear-gradient(to right, rgba(8, 11, 17, .95) 15%, rgba(8, 11, 17, 0)); }
.fl-fade.r { right: 0; top: 0; bottom: 0; width: 46px; padding-right: 5px; justify-content: flex-end; border-radius: 0 12px 12px 0; background: linear-gradient(to left, rgba(8, 11, 17, .95) 15%, rgba(8, 11, 17, 0)); }
.fl-fade.t { left: 0; right: 0; top: 0; height: 18px; border-radius: 12px 12px 0 0; background: linear-gradient(to bottom, rgba(8, 11, 17, .9), rgba(8, 11, 17, 0)); }
.fl-fade.b { left: 0; right: 0; bottom: 0; height: 22px; border-radius: 0 0 12px 12px; background: linear-gradient(to top, rgba(8, 11, 17, .95), rgba(8, 11, 17, 0)); }

/* a branch label */
.fl-label { position: absolute; height: 44px; display: flex; align-items: center; gap: 5px; font-size: 10px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; color: var(--dim); white-space: nowrap; cursor: pointer; padding: 0 2px; transition: color .15s, text-shadow .15s; }
.fl-label:hover { color: var(--text); }
.fl-label.slim { height: 20px; }
.fl-label .n { font-weight: 500; letter-spacing: 0; text-transform: none; color: var(--dim); border: 1px solid var(--line); border-radius: 10px; padding: 0 8px; font-size: 11px; line-height: 18px; max-width: 300px; overflow: hidden; text-overflow: ellipsis; background: rgba(255, 255, 255, .04); }
.fl-label.folded:hover .n { color: var(--text); border-color: var(--el); }
.fl-label .x { display: none; width: 15px; height: 15px; line-height: 13px; padding: 0; border-radius: 50%; font-size: 11px; color: var(--dim); text-transform: none; }
.fl-label:hover .x, .fl-label.loose .x { display: inline-block; }
.fl-label.loose { color: var(--warn); }

/* adding */
.fl-add { position: absolute; width: 26px; height: 26px; margin-top: 9px; padding: 0 !important; border-radius: 50% !important; border: 1px dashed var(--line2) !important; background: rgba(255, 255, 255, .03) !important; color: var(--dim) !important; display: flex; align-items: center; justify-content: center; }
.fl-add.slim { width: 18px; height: 18px; margin-top: 1px; }
.fl-add.slim svg { width: 12px; height: 12px; }
.fl-dest.slim { height: 20px; }
.fl-add:hover { color: #f1ead8 !important; border-color: var(--el) !important; border-style: solid !important; background: var(--el-soft) !important; box-shadow: 0 0 12px var(--el-soft); }
.fl-ins { position: absolute; width: 14px; height: 14px; padding: 0 !important; border-radius: 50% !important; border: 1px solid var(--line2) !important; background: #0d1017 !important; color: var(--dim) !important; display: flex; align-items: center; justify-content: center; opacity: .5; }
.jw-strip:hover .fl-ins { opacity: .9; }
.fl-ins:hover { opacity: 1 !important; color: #f1ead8 !important; border-color: var(--el) !important; background: var(--el) !important; transform: scale(1.25); }
.fl-phase { position: absolute; height: 26px; margin-top: 9px; font-size: 11px; padding: 0 10px !important; border-radius: 13px !important; border: 1px dashed var(--line2) !important; background: transparent !important; color: var(--dim) !important; white-space: nowrap; }
.fl-phase:hover:not(:disabled) { color: #f1ead8 !important; border-color: var(--el) !important; }
.fl-drop { position: absolute; width: 3px; height: 44px; border-radius: 2px; background: var(--el); box-shadow: 0 0 10px var(--el); pointer-events: none; }
.fl-card.dragging { opacity: .35; }

/* ── playback: what the technique is doing right now ── */
@keyframes fl-run { from { transform: translateX(-100%); } to { transform: translateX(260%); } }
@keyframes fl-flash { 0% { box-shadow: 0 0 0 2px #fff, 0 0 26px 6px var(--ln); background: rgba(255, 255, 255, .34); } 100% { box-shadow: 0 0 0 1px var(--ln), 0 0 8px 0 var(--ln); background: var(--glass2); } }
@keyframes fl-breathe { 0%, 100% { box-shadow: 0 0 0 1px var(--ln), 0 0 12px 1px var(--ln); } 50% { box-shadow: 0 0 0 1px var(--ln), 0 0 20px 3px var(--ln); } }
.fl-card .run { position: absolute; left: 0; right: 0; bottom: 0; height: 2px; overflow: hidden; border-radius: 0 0 9px 9px; display: none; }
.fl-card .run::after { content: ''; display: block; width: 40%; height: 100%; background: linear-gradient(90deg, transparent, #1a1e28, transparent); animation: fl-run 1.1s linear infinite; }
.fl-card.live { border-color: var(--ln); background: rgba(46, 58, 80, .95); animation: fl-breathe 1.4s ease-in-out infinite; }
.fl-card.live .run { display: block; }
.fl-card.live .t { color: #f1ead8; }
.fl-card.flash { animation: fl-flash .36s ease-out both; border-color: var(--ln); }
.fl-card.done:not(.live):not(.flash) { border-color: color-mix(in srgb, var(--ln) 55%, transparent); box-shadow: 0 0 6px -1px var(--ln); }
.fl-card .tick { display: none; position: absolute; right: 5px; bottom: 3px; font: normal 9px/1 system-ui; color: var(--ln); opacity: .9; }
.fl-card .tick::before { content: '✓'; }
.fl-card.done:not(.live) .tick { display: block; }
.fl-card.fl-end.done { border-color: var(--el); box-shadow: 0 0 0 1px var(--el), 0 0 16px var(--el-soft); }
.fl-card.fl-end.done .t { color: #f1ead8; }
.fl-label.live { color: #f1ead8; text-shadow: 0 0 10px var(--el), 0 0 2px var(--el); }
.fl-label.live .n { border-color: var(--el); color: #f1ead8; box-shadow: 0 0 12px var(--el); background: var(--el-soft); }
.fl-label.flash .n { border-color: #38352f; color: #f1ead8; box-shadow: 0 0 14px var(--el); }
.fl-label.flash { color: #f1ead8; text-shadow: 0 0 12px #fff; }

/* buttons that end a live hold, when the arena is not pressing them itself */
/* under the play buttons: clear of the bottom-centre band, where the game puts its own readouts above the strip */
.jw-live { position: absolute; left: 50%; top: 64px; transform: translateX(-50%); white-space: nowrap; display: flex; gap: 6px; align-items: center; z-index: 5; padding: 5px 8px; border-radius: 10px; }
.jw-live:empty { display: none; }
.jw-live .lbl { font-size: 11px; color: var(--dim); margin-right: 2px; }
.jw-live button { background: rgba(10, 14, 22, .7); }

/* ── the inspector ── */
.jw-inspector { position: absolute; width: 348px; display: flex; flex-direction: column; z-index: 7; min-height: 120px; transition: left .16s ease-out; }
.jw-inspector.dragging { transition: none; }
.jw-insp-head { display: flex; align-items: center; gap: 8px; padding: 9px 8px 8px 14px; border-bottom: 1px solid var(--line); cursor: grab; flex: none; }
.jw-insp-head:active { cursor: grabbing; }
.jw-insp-head .dot { width: 9px; height: 9px; border-radius: 3px; background: var(--ln, var(--el)); box-shadow: 0 0 8px var(--ln, var(--el)); flex: none; }
.jw-insp-head .ttl { font-weight: 700; font-size: 14px; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.jw-insp-head button { flex: none; }
.jw-insp { overflow-y: auto; overflow-x: hidden; min-height: 0; padding: 10px 12px 12px 14px; flex: 1; }
.jw-insp .sub { color: var(--dim); font-size: 12px; margin-bottom: 10px; }
.jw-insp .grp { border-top: 1px solid var(--line); margin-top: 10px; padding-top: 8px; }
.jw-insp .grp > .gt { font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--dim); margin-bottom: 6px; }
.jw-insp .grp.acts { display: flex; gap: 6px; flex-wrap: wrap; }
.jw-branches { display: flex; flex-wrap: wrap; gap: 5px; margin: 0 0 10px; align-items: center; }
.jw-branches .lbl { font-size: 11px; color: var(--dim); }
.jw-branches button { font-size: 11.5px; padding: 2px 9px; border-radius: 11px; border-style: dashed; }
.jw-branches button.have { border-style: solid; color: var(--dim); }
/* what only shows once "Advanced" is opened: internal names, and which branch runs which steps */
.jw-insp:not(.adv) .jw-advrow, .jw-insp:not(.adv) .jw-seqrow, .jw-insp:not(.adv) .grp.advgrp { display: none; }
.jw-seqrow > label, .jw-advrow > label { color: #e2d3a6 !important; }
.jw-advtoggle { display: flex !important; margin-top: 12px; width: 100%; text-align: left; color: var(--dim) !important; font-size: 11.5px; }
.jw-f { display: grid; grid-template-columns: 108px minmax(0, 1fr); gap: 4px 8px; align-items: center; margin-bottom: 6px; }
.jw-f > label { font-size: 12px; color: #e2d3a6; }
.jw-f > label .req { color: var(--bad); }
.jw-f .ctl { display: flex; gap: 4px; align-items: center; min-width: 0; flex-wrap: wrap; }
.jw-f .ctl > input[type=number] { width: 68px; }
.jw-f.wide { grid-template-columns: minmax(0, 1fr); }
.jw-f.wide > label { font-weight: 600; color: var(--text); }
.jw-f.wide > .help, .jw-f.wide > .err, .jw-f.wide > .wrn { grid-column: 1; }
.jw-f .ctl > input[type=text], .jw-f .ctl > select { flex: 1; }
.jw-f .unit { font-size: 11px; color: var(--dim); }
.jw-f .help { grid-column: 2; font-size: 11px; color: var(--faint); margin-top: -2px; }
.jw-f .err { grid-column: 1 / -1; font-size: 11.5px; color: var(--bad); }
.jw-f .wrn { grid-column: 1 / -1; font-size: 11.5px; color: var(--warn); }
.jw-box { border: 1px solid var(--line); border-radius: 7px; padding: 6px; background: rgba(255, 255, 255, .03); flex: 1; min-width: 0; }
.jw-box .jw-f { grid-template-columns: 84px minmax(0, 1fr); margin-bottom: 4px; }
.jw-empty { color: var(--dim); padding: 18px 6px; text-align: center; }
.jw-prob { font-size: 12px; padding: 5px 8px; border-radius: 6px; margin-bottom: 4px; cursor: pointer; border-left: 3px solid var(--bad); background: rgba(255, 107, 107, .1); }
.jw-prob.w { border-left-color: var(--warn); background: rgba(251, 191, 36, .09); }
.jw-prob:hover { filter: brightness(1.3); }

/* inspector controls made from tables (one control per definition path) */
.jw-val { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.jw-val > .ctl { flex-wrap: wrap; }
.jw-val .jw-val { flex: 1; }
.jw-f .ctl select.jw-mode, .jw-val select.jw-mode { flex: 0 1 96px; min-width: 70px; color: var(--dim); }
.jw-f .ctl > .jw-val > .ctl > input[type=number], .jw-val input[type=number] { width: 64px; }
.jw-val input[type=text], .jw-val select:not(.jw-mode) { flex: 1; min-width: 60px; }
.jw-asset { display: flex; gap: 3px; align-items: center; flex: 1; min-width: 0; }
.jw-asset > input[type=text], .jw-asset > select { flex: 1; min-width: 0; }
.jw-asset > input[type=number] { width: 68px; }
.jw-bool { display: inline-flex; gap: 6px; align-items: center; }
.jw button.jw-x { padding: 0 5px; font-size: 13px; line-height: 18px; flex: none; }
.jw-chk { display: inline-flex; gap: 3px; align-items: center; font-size: 12px; color: #e2d3a6; margin-right: 6px; }
.jw button.jw-more { display: block; font-size: 11.5px; padding: 1px 4px; margin: 2px 0 4px; color: var(--accent); }
.jw-adder { display: flex; gap: 4px; align-items: center; flex-wrap: wrap; margin-top: 4px; }
.jw-adder input[type=text] { flex: 1; min-width: 80px; }
.jw-adder select { flex: 0 1 86px; }
.jw-adder .err { flex-basis: 100%; }
.jw-chips { display: flex; flex-wrap: wrap; gap: 2px; margin: 2px 0; }
.jw-chips button { font-size: 11.5px; color: var(--accent); }
.jw-entry { border: 1px solid var(--line); border-radius: 7px; padding: 6px; margin-bottom: 6px; background: rgba(0, 0, 0, .18); }
.jw-entry-foot { display: flex; gap: 4px; justify-content: flex-end; }
.jw-entry-foot button { font-size: 11.5px; }
.jw-box .jw-box { background: rgba(0, 0, 0, .18); padding: 5px; }
.jw-box > .help { font-size: 11px; color: var(--faint); margin-bottom: 4px; }
.jw-anchor { margin: 0; }
.jw-anchor > .err, .jw-f > .err, .jw-adder .err { font-size: 11.5px; color: var(--bad); }
.jw-anchor > .wrn { font-size: 11.5px; color: var(--warn); }
.jw-anchor > .err, .jw-anchor > .wrn { margin-bottom: 6px; }
.jw-f > label[title] { cursor: help; }
.jw-f textarea { resize: vertical; min-height: 40px; }
.jw-box .jw-f.wide { grid-template-columns: minmax(0, 1fr); }
.jw-box .jw-f.wide > .help { grid-column: 1; }
.jw-refused { grid-column: 1 / -1; font-size: 11.5px; color: var(--bad); }
.jw-foot { margin-top: 12px; padding-top: 6px; border-top: 1px dashed var(--line); opacity: .75; }
.jw-foot:hover, .jw-foot:focus-within { opacity: 1; }
.jw-foot-links { font-size: 11.5px; line-height: 1.7; }
.jw-foot-links .jw-more { margin: 0 2px 0 0; }
.jw-foot-links .jw-more.on { color: var(--text); border-color: var(--el); }
.jw-seqname { flex: 0 1 96px !important; min-width: 56px; font-size: 11.5px; color: #e2d3a6 !important; }

/* ── popovers: picker, palette, options, problems, menus, the new-technique dialog ── */
.jw-veil { position: absolute; inset: 0; z-index: 20; }
.jw-veil.dim { background: rgba(3, 5, 9, .5); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); }
.jw-pop { position: absolute; z-index: 21; padding: 10px; max-height: 76vh; overflow: auto; background: rgba(13, 17, 26, .9); }
.jw-pop h5 { margin: 10px 2px 5px; font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .09em; color: var(--dim); }
.jw-pop h5:first-child { margin-top: 2px; }
.jw-pop .search { width: 100%; padding: 7px 10px; font-size: 13.5px; border-radius: 8px; margin-bottom: 8px; }
.jw-pop .none { color: var(--dim); padding: 14px 6px; text-align: center; font-size: 12px; }

.jw-picker { width: 340px; display: flex; flex-direction: column; overflow: hidden; padding: 10px 10px 8px; }
.jw-list { overflow-y: auto; min-height: 0; flex: 1; margin: 0 -4px; padding: 0 4px; }
.jw-item { display: flex; align-items: center; gap: 10px; padding: 5px 8px; cursor: pointer; border-radius: 8px; border: 1px solid transparent; }
.jw-item:hover, .jw-item.hot { background: rgba(255, 255, 255, .08); }
.jw-item.sel { background: var(--el-soft); border-color: var(--el); }
.jw-item .ico { width: 32px; height: 32px; flex: none; border-radius: 6px; overflow: hidden; background: rgba(0, 0, 0, .4); display: flex; align-items: center; justify-content: center; }
.jw-item .ico > * { transform: scale(.8); transform-origin: center; flex: none; }
.jw-item .nm { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.jw-item .mt { font-size: 11px; color: var(--dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-transform: capitalize; }
.jw-item .dot { width: 7px; height: 7px; border-radius: 50%; flex: none; margin-left: auto; background: transparent; }
.jw-item .dot.draft { background: var(--warn); box-shadow: 0 0 8px var(--warn); }
.jw-item .dot.gap { background: var(--bad); }
.jw-picker .foot { display: flex; gap: 6px; padding-top: 8px; margin-top: 6px; border-top: 1px solid var(--line); flex: none; }
.jw-picker .foot button { flex: 1; padding: 6px 8px; white-space: nowrap; }

/* the technique's icon: the cell shown in the inspector, and the sheet to choose from (one column per element) */
.jw-icon, .jw-iconnew { display: block; flex: none; background: #21242c; border-radius: 4px; image-rendering: pixelated; }
.jw-iconnew { width: 40px; height: 40px; }
.jw .jw-iconpick { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; padding: 4px 8px 4px 4px; text-align: left; }
.jw .jw-iconpick .nm { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--dim); }
.jw-picker.jw-icons { width: auto; max-width: calc(100vw - 20px); }
.jw-iconscroll { overflow: auto; min-height: 0; flex: 1; }
.jw-icongrid { display: grid; gap: 4px; }
.jw-icongrid .hd { position: sticky; top: 0; z-index: 1; padding: 1px 0 5px; font-size: 10px; font-weight: 700; text-align: center; white-space: nowrap; background: rgb(13, 17, 26); }
.jw .jw-iconcell { width: 52px; height: 52px; padding: 0; justify-content: center; border-radius: 7px; border: 2px solid transparent; background: transparent; }
.jw .jw-iconcell:hover:not(:disabled) { border-color: var(--accent); background: transparent; }
.jw .jw-iconcell.sel { border-color: var(--el); box-shadow: 0 0 10px var(--el-soft); }
.jw .jw-iconcell.empty { opacity: 1; cursor: default; border: 1px dashed var(--line); }
.jw-iconadd { flex: none; width: 0; min-width: 100%; margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.jw-iconadd select { flex: 1; min-width: 0; }
.jw-iconadd .help { flex-basis: 100%; font-size: 11px; color: var(--dim); }
.jw-iconadd .err { flex-basis: 100%; font-size: 11.5px; color: var(--bad); }

.jw-palette { width: 470px; }
.jw-palette .opts { display: grid; grid-template-columns: 1fr 1fr; gap: 5px; }
.jw-palette .opt { display: block; text-align: left; padding: 6px 9px 6px 14px; border-radius: 8px; position: relative; white-space: normal; }
.jw-palette .opt::before { content: ''; position: absolute; left: 5px; top: 8px; bottom: 8px; width: 3px; border-radius: 2px; background: var(--ln, var(--flow)); }
.jw-palette .opt b { font-weight: 600; display: block; }
.jw-palette .opt small { display: block; color: var(--dim); font-size: 11px; line-height: 1.3; }
.jw-palette .opt.hot { border-color: var(--el); background: var(--el-soft); }
.jw-palette .sugg { display: flex; flex-wrap: wrap; gap: 5px; }
.jw-palette .sugg .opt { display: inline-block; padding: 5px 12px 5px 16px; }

.jw-menu { min-width: 190px; padding: 6px; }
.jw-menu button { display: flex; width: 100%; align-items: center; gap: 8px; text-align: left; background: transparent; border-color: transparent; padding: 5px 9px; border-radius: 7px; white-space: nowrap; }
.jw-menu button:hover:not(:disabled) { background: rgba(255, 255, 255, .1); }
.jw-menu button.danger { color: var(--bad); }
.jw-menu hr { border: 0; border-top: 1px solid var(--line); margin: 5px 2px; }
.jw-menu h5 { margin: 6px 9px 3px; }

.jw-options { width: 300px; padding: 12px; }
.jw-options .row { display: grid; grid-template-columns: 104px minmax(0, 1fr); gap: 8px; align-items: center; margin-bottom: 7px; font-size: 12px; color: #e2d3a6; }
.jw-options .row select { width: 100%; }
.jw-options label.chk { display: flex; align-items: center; gap: 7px; font-size: 12px; color: #e2d3a6; margin-bottom: 5px; cursor: pointer; }
.jw-options .btns { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.jw-options .btns button { font-size: 12px; }

.jw-problems { width: 400px; }

.jw-dialog { width: 600px; left: 50%; top: 50%; transform: translate(-50%, -52%); padding: 20px 22px 16px; border-radius: 16px; max-height: calc(100vh - 24px) !important; }
.jw-dialog h3 { margin: 0 0 14px; font-size: 17px; letter-spacing: .01em; }
.jw-dialog .two { display: grid; grid-template-columns: 1fr 170px; gap: 12px; margin-bottom: 14px; }
.jw-dialog label.f { display: block; font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .09em; color: var(--dim); margin-bottom: 5px; }
.jw-dialog input[type=text], .jw-dialog select { width: 100%; padding: 8px 10px; font-size: 14px; border-radius: 8px; }
.jw-dialog .tpls { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.jw-dialog .tpl { text-align: left; padding: 9px 10px 10px; border-radius: 10px; min-height: 86px; display: flex; flex-direction: column; gap: 3px; white-space: normal; }
.jw-dialog .tpl b { font-size: 13px; }
.jw-dialog .tpl small { color: var(--dim); font-size: 11px; line-height: 1.3; }
.jw-dialog .tpl.on { border-color: var(--el); background: var(--el-soft); box-shadow: 0 0 16px var(--el-soft); }
.jw-dialog .tpl .mini { margin-top: auto; padding-top: 6px; font-size: 10px; color: var(--el); letter-spacing: .02em; }
.jw-dialog .btns { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }
.jw-dialog .btns button { padding: 7px 18px; }

/* Authoring uses the workspace popup, inspector rows, element tint and standard controls. */
.jw-authoring-trigger { flex: none; white-space: nowrap; }
.jw-authoring { width: min(540px, calc(100vw - 32px)); left: 50%; top: 50%; transform: translate(-50%, -50%);
  display: flex; flex-direction: column; max-height: calc(100vh - 40px); overflow: hidden; padding: 0; }
.jw-authoring .jw-insp-head { cursor: default; }
.jw-authoring-body { padding: 12px 16px 16px; }
.jw-authoring .jw-f > label { align-self: center; }
.jw-authoring .jw-f.wide > label { margin-bottom: 2px; }
.jw-authoring textarea { width: 100%; min-height: 112px; resize: vertical; line-height: 1.5; }
.jw-authoring input[readonly] { color: var(--dim); }
.jw-authoring [hidden] { display: none !important; }
.jw-authoring-message { color: var(--dim); font-size: 12px; margin: 10px 0 0; }
.jw-authoring-message:empty, .jw-authoring-warnings:empty { display: none; }
.jw-authoring-message.error { color: var(--bad); }
.jw-authoring-summary { margin: 0 0 8px; }
.jw-authoring-warnings { margin: 6px 0 10px; padding-left: 18px; color: var(--warn); font-size: 12px; }
.jw-authoring-warnings li + li { margin-top: 5px; }
.jw-authoring-data { color: var(--dim); font-size: 12px; margin: 10px 0; }
.jw-authoring-data summary { cursor: pointer; }
.jw-authoring-data pre { max-height: 180px; overflow: auto; padding: 8px; border: 1px solid var(--line); border-radius: 6px;
  background: var(--field); color: var(--text); font: 11px/1.5 ui-monospace, Menlo, Consolas, monospace; white-space: pre-wrap; overflow-wrap: anywhere; user-select: text; }
.jw-authoring-review { align-items: flex-start; line-height: 1.5; color: var(--dim); font-size: 12px; }
.jw-authoring-review input { margin: 2px 0 0; flex: none; }
.jw-authoring-foot { flex: none; display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 6px;
  padding: 10px 12px; border-top: 1px solid var(--line); }
.jw-authoring-foot .sp { flex: 1; }
.jw-authoring-preview { width: min(380px, calc(100vw - 24px)); left: auto; right: 12px; top: 68px; transform: none; max-height: calc(100vh - 92px); }
.jw-authoring-preview-veil { pointer-events: none; }
@media (max-width: 1450px) {
  .jw-authoring-trigger .label { display: none; }
  .jw button.jw-authoring-trigger { width: 30px; height: 30px; padding: 0; justify-content: center; }
}

/* ── what happened, and the message card ── */
.jw-logbox { position: absolute; left: 14px; top: 110px; max-width: 420px; font: 11px/1.5 ui-monospace, Menlo, Consolas, monospace; color: #e2d3a6; background: rgba(6, 9, 14, .62); padding: 7px 10px; border-radius: 8px; pointer-events: none; white-space: pre-wrap; z-index: 4; border: 1px solid var(--line); }
.jw-card { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; padding: 24px; text-align: center; background: rgba(7, 10, 16, .92); z-index: 4; }
.jw-card > div { max-width: 460px; }
.jw-card h3 { margin: 0 0 8px; font-size: 16px; }
.jw-card p { margin: 0 0 12px; color: var(--dim); }

/* the classic form, shown over the arena for whoever needs the old fields */
.jw-classic { position: absolute; inset: 66px 12px 12px; overflow: auto; background: #1a1e28; color: #d9d3c4; padding: 16px; border-radius: 12px; z-index: 8; user-select: text; -webkit-user-select: text; }
.jw-classic #jutsu-editor { display: block !important; }
.jw-classic-bar { position: absolute; left: 12px; right: 12px; top: 10px; height: 46px; display: flex; align-items: center; gap: 12px; padding: 0 14px; z-index: 9; }

/* A branch the selected card could have and does not yet: its words and its "+" are the offer. */
.fl-label.offer { color: var(--el); opacity: .9; cursor: pointer; }
.fl-label.offer .w::before { content: '+ '; }
.fl-label.offer:hover { color: #f1ead8; text-shadow: 0 0 10px var(--el-soft); }
.fl-add.offer { border-color: var(--el) !important; color: var(--el) !important; }

/* Which steps come with branches: said where a step is chosen, and on a card that can have none. */
.jw-palette .opt .br { display: block; margin-top: 2px; font-size: 10.5px; letter-spacing: .02em; color: var(--accent); opacity: .85; }
.jw-branches.none { align-items: flex-start; flex-wrap: nowrap; }
.jw-branches.none .why { font-size: 11px; line-height: 1.35; color: var(--dim); }

/* ── learning the editor: the Tutorial button, its box (tour, FAQ, recipes), and the tour itself ── */
.jw-learn-btn { white-space: nowrap; }
.jw-learn-btn svg { color: var(--el); }
.jw-dialog.jw-learn { width: min(860px, calc(100vw - 40px)); height: min(86vh, 900px); display: flex; flex-direction: column; overflow: hidden; padding: 18px 20px 14px; }
.jw-learn .hd { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.jw-learn .hd h3 { margin: 0; }
.jw-learn .go { display: flex; align-items: center; gap: 14px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: rgba(255, 255, 255, .04); margin-bottom: 14px; }
.jw-learn .go span { color: var(--dim); font-size: 12.5px; line-height: 1.4; }
.jw-learn .jw-begin { padding: 9px 18px; font-size: 14px; white-space: nowrap; flex: none; }
.jw-learn > h5 { margin: 0 2px 6px; }
.jw-learn .search { margin-bottom: 4px; }
.jw-learn .cnt { color: var(--faint); font-size: 11.5px; margin: 0 2px 6px; }
.jw-learn .kb { flex: 1; min-height: 0; overflow: auto; padding-right: 6px; user-select: text; -webkit-user-select: text; }
.jw-learn .kb h4 { margin: 14px 0 6px; padding: 4px 2px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .09em; color: var(--el); position: sticky; top: 0; z-index: 1; background: rgb(13, 17, 26); }
.jw-learn .kb h4:first-child { margin-top: 0; }
.jw-learn .qa { border: 1px solid var(--line); border-radius: 9px; margin-bottom: 5px; background: rgba(255, 255, 255, .03); }
.jw-learn .qa[open] { border-color: var(--line2); background: rgba(255, 255, 255, .05); }
.jw-learn .qa summary { cursor: pointer; padding: 8px 12px; font-weight: 600; font-size: 13px; }
.jw-learn .qa summary:hover { color: #f1ead8; }
.jw-learn .ans { padding: 0 14px 10px; color: #e2d3a6; font-size: 13px; line-height: 1.5; }
.jw-learn .ans p { margin: 0 0 8px; }
.jw-learn .ans ol, .jw-learn .ans ul { margin: 0 0 8px; padding-left: 20px; }
.jw-learn .ans li { margin-bottom: 4px; }
.jw-learn .ans b { color: #f1ead8; }
.jw-learn .ans .note { border-left: 2px solid var(--warn); padding-left: 10px; color: var(--text); }

.jw-tour { position: absolute; inset: 0; z-index: 40; }
.jw-tour.nohole { background: rgba(3, 5, 9, .62); }
.jw-tour.nohole .jw-tour-hole { display: none; }
.jw-tour-hole { position: absolute; border-radius: 12px; border: 2px solid var(--el); box-shadow: 0 0 0 9999px rgba(3, 5, 9, .62), 0 0 24px var(--el-soft); pointer-events: none; }
.jw-tour-box { position: absolute; width: 390px; padding: 14px 16px 12px; background: rgba(13, 17, 26, .97); border-color: var(--line2); }
.jw-tour-box .n { font-size: 10.5px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; color: var(--dim); }
.jw-tour-box h4 { margin: 4px 0 8px; font-size: 16px; }
.jw-tour-box p { margin: 0 0 8px; font-size: 13px; line-height: 1.5; color: #e2d3a6; }
.jw-tour-box p b { color: #f1ead8; }
.jw-tour-box .btns { display: flex; align-items: center; gap: 8px; margin-top: 10px; }
.jw-tour-box .btns .sp { flex: 1; }

/* ── the "?" beside every setting, group and option, and its bubble (07c-help.js) ── */
.jw-q { display: inline-flex; align-items: center; justify-content: center; width: 14px; height: 14px; margin-left: 5px; vertical-align: 1px; border-radius: 50%;
  border: 1px solid var(--line2); color: var(--dim); font: 700 9.5px/1 system-ui, sans-serif; cursor: help; user-select: none; flex: none; text-transform: none; letter-spacing: 0; }
.jw-q:hover, .jw-q:focus-visible { color: #d9d3c4; background: var(--el); border-color: var(--el); outline: none; }
.jw-tip { position: fixed; z-index: 60; display: none; max-width: 300px; padding: 9px 11px; border-radius: 9px; background: rgba(12, 16, 25, .97); border: 1px solid var(--line2);
  box-shadow: 0 8px 28px rgba(0, 0, 0, .55); color: #e2d3a6; font-size: 12px; line-height: 1.45; white-space: pre-line; pointer-events: none; }
.jw-tip.pinned { pointer-events: auto; border-color: var(--el); }
.jw-tip p { margin: 0; }
.jw-tip p + p { margin-top: 7px; }
/* the field rows no longer carry a line of help under them */
.jw-f > label { display: inline-flex; align-items: center; flex-wrap: wrap; }
/* "Runs when": the moment a card runs, at the top of its panel */
.jw-when { font-size: 11.5px; color: #e2d3a6; line-height: 1.35; }
/* a card that ran and reached nobody */
.fl-card.nobody { border-color: rgba(255, 107, 107, .65); }
.fl-card .nob.jw-q { position: absolute; right: 6px; bottom: -8px; width: auto; height: 14px; margin: 0; padding: 0 6px; border-radius: 7px; font: 600 9.5px/14px system-ui, sans-serif;
  background: #33231f; border-color: var(--bad); color: #c9745c; white-space: nowrap; }
.fl-card .nob.jw-q:hover { background: var(--bad); color: #c9745c; }
.jw-options .row > span:first-child { display: inline-flex; align-items: center; }
.jw-options .chk .jw-q { margin-left: 6px; }

/* ── the VFX editor: an effect edited in place, on the same strip (07d-vfx.js) ── */
/* the way back: Technique › Effect */
.jw-crumb-back .nm { color: var(--dim); }
.jw-crumb-back:hover .nm { color: #f1ead8; }
.jw-crumb-sep { color: var(--faint); font-size: 18px; margin: 0 2px; }
.jw-crumb { display: inline-flex; align-items: center; gap: 7px; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 260px; }
.jw-crumb b { overflow: hidden; text-overflow: ellipsis; }
.jw-chip.fx { background: rgba(61, 220, 151, .16); color: var(--vfx); }
.jw-fxclock { font: 600 11.5px/1 ui-monospace, Consolas, monospace; color: #e2d3a6; white-space: nowrap; min-width: 210px; }
.jw-stepbtn { font-size: 15px; line-height: 1; }
/* an Effect card opens its effect */
.fl-card .fl-fxedit { position: absolute; right: -9px; top: -9px; width: 20px; height: 20px; padding: 0; border-radius: 50%; font-size: 11px; line-height: 18px;
  background: #0d1017; border: 1px solid var(--vfx); color: var(--vfx); opacity: 0; transition: opacity .12s; }
.fl-card:hover .fl-fxedit, .fl-card.sel .fl-fxedit, .fl-card .fl-fxedit:focus-visible { opacity: 1; }
.fl-card .fl-fxedit:hover { background: var(--vfx); color: #93ad86; }
/* a soloed layer: the only one drawn in the arena */
.fl-card.solo { box-shadow: 0 0 0 2px var(--vfx), 0 0 14px rgba(61, 220, 151, .35); }
.fl-card.solo::after { content: 'SOLO'; position: absolute; right: 6px; top: -8px; font: 700 9px/13px system-ui, sans-serif; letter-spacing: .08em; padding: 0 5px; border-radius: 7px; background: var(--vfx); color: #93ad86; }
/* the effect picker on a technique's card */
.jw-fx-acts { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 5px; }
.jw-fx-acts button { font-size: 12px; }
.jw-shared { margin-top: 5px; font-size: 11.5px; line-height: 1.4; color: var(--warn); }
/* colour over life */
.jw-grad { display: flex; flex-direction: column; gap: 4px; }
.jw-grad-bar { height: 16px; border-radius: 4px; border: 1px solid var(--line2); }
.jw-grad-stop { display: flex; align-items: center; gap: 4px; }
.jw-grad-stop input[type=number] { width: 56px; }
.jw-grad .jw-x { padding: 0 6px; }
/* a particle picture */
.jw-tex { width: 26px; height: 26px; border-radius: 4px; object-fit: contain; background: repeating-conic-gradient(#1a1e28 0 25%, #0d1017 0 50%) 0 0 / 8px 8px; border: 1px solid var(--line2); flex: none; }
/* the "?" story: the card it belongs to (the ▶ line) */
.jw-tip .jw-tip-now { display: block; margin: 3px -6px; padding: 3px 6px; border-radius: 5px; color: #e2d3a6; background: rgba(255, 216, 77, .13); border-left: 2px solid #8d7a4e; font-weight: 600; }
/* under the technique's name while an effect is open: an arrow up at it, and the way back */
.jw-name.jw-crumb-back { position: relative; overflow: visible; }
.jw-crumb-hint { position: absolute; left: 8px; top: calc(100% + 11px); padding: 4px 10px; border-radius: 8px; white-space: nowrap; pointer-events: none;
  font: 600 12px/1.2 system-ui, sans-serif; letter-spacing: 0; text-transform: none; color: #e2d3a6;
  background: rgba(12, 16, 25, .94); border: 1px solid rgba(255, 216, 77, .7); box-shadow: 0 6px 18px rgba(0, 0, 0, .45); }
.jw-crumb-hint::before { content: ''; position: absolute; left: 14px; top: -6px; width: 10px; height: 10px; transform: rotate(45deg);
  background: rgba(12, 16, 25, .94); border-left: 1px solid rgba(255, 216, 77, .7); border-top: 1px solid rgba(255, 216, 77, .7); }

/* ── a particle's life under its layer card, and clicking a particle (07e-vfx-stages.js) ── */
.fl-card.fl-pstage { cursor: pointer; min-width: 74px; }
.fl-card.fl-pstage .t { font-size: 12px; }
.fl-card.fl-pstage:hover { border-color: var(--ln); }
/* the clicked particle is here: yellow, like the "?" story's own card */
.fl-card.picked { border-color: #8d7a4e !important; box-shadow: 0 0 0 1px #ffd84d, 0 0 16px rgba(255, 216, 77, .35); }
.fl-card.picked .t { color: #e2d3a6; }
/* Looks: its colour over life, and where along it the clicked particle is */
.fl-card .fl-gradbar { position: absolute; left: 15px; right: 12px; bottom: 4px; height: 4px; border-radius: 2px; }
.fl-card .fl-lifeat { position: absolute; bottom: 9px; width: 0; height: 0; margin-left: -5px; border-left: 5px solid transparent; border-right: 5px solid transparent; border-top: 7px solid #8d7a4e; filter: drop-shadow(0 0 2px #000); }
/* how many particles a layer has alive */
.fl-card .fl-alive { position: absolute; right: 6px; bottom: -8px; min-width: 0; padding: 0 5px; border-radius: 7px; font: 600 9.5px/14px ui-monospace, Consolas, monospace; background: #0d1017; border: 1px solid var(--vfx); color: var(--vfx); }
.fl-card .fl-alive:empty { display: none; }

/* the ring on a particle: dashed while pointing at it, solid yellow on the one clicked */
.jw-pickring { position: absolute; z-index: 24; pointer-events: none; border-radius: 50%; border: 2px solid #8d7a4e; box-shadow: 0 0 0 2px rgba(0, 0, 0, .55), 0 0 18px rgba(255, 216, 77, .6); }
/* the L-shaped line from a clicked particle's circle to its panel (07e-vfx-stages.js), like the world map's "You're here" */
/* the effects library: how far a converted hand-coded effect got */
.jw-fxlib .row small.conv { display: block; margin-top: 1px; }
.jw-fxlib .row small.conv.ok { color: #93ad86; }
.jw-fxlib .row small.conv.part { color: #e2d3a6; }
.jw-insp .help.warn { color: #e2d3a6; }
.jw-leader { position: fixed; left: 0; top: 0; width: 100vw; height: 100vh; overflow: visible; pointer-events: none; z-index: 29; }
.jw-leader .under { fill: none; stroke: rgba(0, 0, 0, .55); stroke-width: 5; stroke-linecap: round; stroke-linejoin: round; }
.jw-leader .over { fill: none; stroke: #ffd84d; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.jw-leader .end { fill: #ffd84d; stroke: rgba(0, 0, 0, .55); stroke-width: 1.5; }
.jw-pickring.hover { border: 2px dashed rgba(255, 255, 255, .9); box-shadow: 0 0 0 1px rgba(0, 0, 0, .5); }
.jw-pickring .lab { position: absolute; left: 100%; top: 50%; transform: translateY(-50%); margin-left: 10px; white-space: nowrap; padding: 3px 9px; border-radius: 7px;
  font: 600 12px/1.3 system-ui, sans-serif; color: #f1ead8; background: rgba(12, 16, 25, .92); border: 1px solid var(--line2); }

/* the panel beside the mouse */
.jw-quick { position: absolute; z-index: 30; width: 340px; max-height: min(560px, calc(100vh - 80px)); display: flex; flex-direction: column; border-radius: 12px;
  border: 1px solid var(--line2); border-left: 3px solid var(--vfx); box-shadow: 0 14px 40px rgba(0, 0, 0, .55); }
.jw-quick .hd { display: flex; align-items: center; gap: 8px; padding: 9px 8px 4px 12px; }
.jw-quick .hd .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--vfx); flex: none; }
.jw-quick .hd b { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.jw-quick .hd .of { font-size: 11px; color: var(--dim); flex: 1; white-space: nowrap; }
.jw-quick .this { display: flex; align-items: center; gap: 7px; margin: 2px 12px 4px; padding: 5px 8px; border-radius: 7px; font-size: 11.5px; line-height: 1.35;
  color: #e2d3a6; background: rgba(255, 216, 77, .1); border-left: 2px solid #8d7a4e; }
.jw-quick .this .sw { width: 14px; height: 14px; border-radius: 50%; flex: none; border: 1px solid rgba(255, 255, 255, .5); }
.jw-quick .tabs { display: flex; gap: 3px; padding: 6px 12px 2px; flex-wrap: wrap; }
.jw-quick .tabs button { font-size: 12px; padding: 3px 9px; border-radius: 7px; }
.jw-quick .tabs button.on { background: rgba(61, 220, 151, .18); border-color: var(--vfx); color: #f1ead8; }
.jw-quick .what { padding: 4px 12px 2px; font-size: 11.5px; color: var(--dim); line-height: 1.4; }
.jw-quick .body { overflow-y: auto; overflow-x: hidden; padding: 6px 12px 4px; min-height: 0; flex: 1; }
.jw-quick .note { padding: 2px 12px 6px; font-size: 11px; color: var(--dim); }
.jw-quick .acts { display: flex; gap: 6px; padding: 8px 12px 10px; border-top: 1px solid var(--line); }
.jw-quick .acts .sp { flex: 1; }
.jw-quick .also { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; margin: 0 12px 4px; font-size: 11.5px; color: var(--dim); }
.jw-quick .also .chip { font-size: 11.5px; padding: 2px 8px; border-radius: 10px; border-color: var(--vfx); color: #e2d3a6; }

/* ── sprite sheets: the picture, its grid numbered in play order, a player; and uploading (07f-vfx-sheet.js) ── */
.jw-upbtn { font-size: 11.5px; padding: 2px 8px; white-space: nowrap; }
.jw-sheet { display: flex; flex-direction: column; gap: 6px; }
.jw-sheet-dims { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.jw-sheet-dims input[type=number] { width: 52px; }
.jw-sheet-n { margin-left: 4px; color: #e2d3a6 !important; }
.jw-sheet-pic { position: relative; align-self: flex-start; width: fit-content; max-width: 100%; line-height: 0; border-radius: 6px; overflow: hidden;
  background: repeating-conic-gradient(#1a1e28 0 25%, #0d1017 0 50%) 0 0 / 12px 12px; border: 1px solid var(--line2); }
.jw-sheet-pic img { display: block; max-width: 100%; max-height: 240px; min-width: 160px; image-rendering: auto; }
.jw-sheet-pic.big img { max-height: 360px; min-width: 320px; }
.jw-sheet-grid { position: absolute; inset: 0; display: grid; }
.jw-sheet-grid .cell { position: relative; border-right: 1px solid rgba(255, 216, 77, .55); border-bottom: 1px solid rgba(255, 216, 77, .55); cursor: pointer; line-height: 1; }
.jw-sheet-grid .cell span { position: absolute; left: 2px; top: 2px; padding: 1px 3px; border-radius: 3px; font: 700 9.5px/1 ui-monospace, Consolas, monospace; color: #e2d3a6; background: rgba(0, 0, 0, .65); }
.jw-sheet-grid .cell.off { background: rgba(0, 0, 0, .62); }
.jw-sheet-grid .cell.off span { color: #9b9788; }
.jw-sheet-grid .cell.first { box-shadow: inset 3px 0 0 #4ade80; }
.jw-sheet-grid .cell.last { box-shadow: inset -3px 0 0 #ff6b6b; }
.jw-sheet-grid .cell.now { outline: 2px solid #38352f; outline-offset: -2px; background: rgba(255, 255, 255, .14); }
.jw-sheet-grid .cell:hover { background: rgba(255, 216, 77, .16); }
.jw-sheet-info { font-size: 11.5px; color: var(--dim); }
.jw-sheet-info.bad { color: var(--warn); }
.jw-sheet-player { display: flex; align-items: center; gap: 8px; }
.jw-sheet-player canvas { width: 64px; height: 64px; border-radius: 6px; border: 1px solid var(--line2); background: repeating-conic-gradient(#1a1e28 0 25%, #0d1017 0 50%) 0 0 / 8px 8px; flex: none; }
.jw-sheet-player .lab { font-size: 11.5px; color: #e2d3a6; line-height: 1.35; }
.jw-sheet-how .jw-f input[type=number] { width: 52px; }
.jw-upload { width: min(560px, calc(100vw - 40px)); }
.jw-upload .jw-sheet-pic { margin: 10px 0 6px; }
.jw-upload .help { font-size: 12px; color: var(--dim); line-height: 1.45; margin-top: 4px; }
.jw-upload .ctl { display: flex; align-items: center; gap: 6px; }
.jw-upload .ctl input[type=number] { width: 60px; }

/* ── the effects library (07g-vfx-library.js) ── */
button.jw-crumb { background: transparent; border-color: transparent; padding: 3px 8px; }
button.jw-crumb:hover { background: rgba(255, 255, 255, .08); border-color: var(--line); }
.jw-fxlib-btn { font-size: 12.5px; color: var(--vfx); border-color: rgba(61, 220, 151, .45); }
.jw-fxlib { width: 420px; padding: 12px; }
.jw-fxlib h5 { margin: 0 0 8px; font-size: 13px; }
.jw-fxlib .top { display: flex; gap: 6px; margin-bottom: 8px; }
.jw-fxlib .top input { flex: 1; }
.jw-fxlib .list { max-height: 360px; overflow-y: auto; display: flex; flex-direction: column; gap: 3px; }
.jw-fxlib .row { display: flex; align-items: center; gap: 6px; padding: 3px; border-radius: 8px; }
.jw-fxlib .row.on { background: rgba(61, 220, 151, .12); }
.jw-fxlib .row .nm { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: flex-start; text-align: left; background: transparent; border-color: transparent; padding: 4px 6px; }
.jw-fxlib .row .nm:hover { background: rgba(255, 255, 255, .06); border-color: var(--line); }
.jw-fxlib .row .nm b { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.jw-fxlib .row .nm small { font-size: 11px; color: var(--dim); }
.jw-fxlib .help { font-size: 11.5px; color: var(--dim); margin-top: 8px; line-height: 1.4; }

/* ── converting a hand-coded effect (07h-vfx-convert.js) ── */
.jw-fxlib details.builtins { margin-top: 10px; border-top: 1px solid var(--line); padding-top: 8px; }
.jw-fxlib details.builtins summary { cursor: pointer; font-size: 12px; color: #e2d3a6; }
.jw-fxlib details.builtins .row { display: flex; align-items: center; gap: 6px; padding: 3px 4px; }
.jw-fxlib details.builtins .row .nm { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.jw-fxlib details.builtins .row .nm b { font-size: 12.5px; }
.jw-fxlib details.builtins .row .nm small { font-size: 10.5px; color: var(--dim); }
.jw-fxlib details.builtins { max-height: 300px; overflow-y: auto; }
.jw-convert { width: min(620px, calc(100vw - 40px)); }
.jw-convert .verdict { padding: 8px 10px; border-radius: 8px; font-size: 13px; margin: 6px 0 10px; }
.jw-convert .verdict.good { background: rgba(74, 222, 128, .14); color: #93ad86; border-left: 3px solid var(--good); }
.jw-convert .verdict.part { background: rgba(251, 191, 36, .12); color: #e2d3a6; border-left: 3px solid var(--warn); }
.jw-convert .verdict.none { background: rgba(255, 255, 255, .06); color: var(--dim); border-left: 3px solid var(--line2); }
.jw-convert .list { display: flex; flex-direction: column; gap: 4px; max-height: 240px; overflow-y: auto; }
.jw-convert .item { display: flex; flex-direction: column; font-size: 12px; padding: 4px 8px; border-radius: 6px; background: rgba(255, 255, 255, .03); }
.jw-convert .item.ok b { color: var(--good); }
.jw-convert .item.bad b { color: var(--warn); }
.jw-convert .item span { color: var(--dim); word-break: break-word; }
.jw-convert h5 { margin: 10px 0 4px; font-size: 12px; }
.jw-convert ul.missing { margin: 0; padding-left: 18px; font-size: 12px; color: #e2d3a6; max-height: 180px; overflow-y: auto; }
.jw-convert .help { font-size: 12px; color: var(--dim); line-height: 1.45; }
.jw-vec3 { display: flex; align-items: center; gap: 3px; }
.jw-vec3 input[type=number] { width: 58px; }
.jw-rgb input[type=color] { width: 30px; height: 24px; padding: 0 2px; margin-right: 4px; flex: none; }
.jw-rgb input[type=number] { width: 50px; }
.jw-quick .jw-rgb input[type=number] { width: 40px; }
.jw-quick .jw-rgb input[type=color] { width: 26px; }
/* colours / numbers over a particle's life (07h-vfx-convert.js): a bar or graph, then one row per stop */
.jw-stops { gap: 5px; }
/* COLOURIZE: every colour at once (a list's, a layer's, the effect's) */
.jw-colorize-row { display: flex; justify-content: flex-end; margin: 0 0 4px; }
.jw-colorize { display: inline-flex; align-items: center; gap: 6px; padding: 3px 4px 3px 8px; border: 1px solid var(--line); border-radius: 7px; background: rgba(255, 255, 255, .05); color: var(--dim); font-size: 12px; cursor: pointer; }
.jw-colorize:hover { color: var(--text); border-color: var(--line2); }
.jw-colorize svg { fill: currentColor; }
.jw-colorize input[type=color] { width: 26px; height: 20px; padding: 0; border: 1px solid var(--line2); border-radius: 4px; background: none; cursor: pointer; }
.jw-stop { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; }
.jw-stop input[type=number] { width: 52px; }
.jw-stop .jw-color4 { display: inline-flex; align-items: center; gap: 4px; }
.jw-stop .jw-color4 input[type=color] { width: 28px; height: 22px; padding: 0 2px; }
.jw-stop-or { padding-left: 22px; }
.jw-stop .jw-or { padding: 0 6px; font-size: 11px; opacity: .8; }
.jw-stop .jw-or2 { display: inline-flex; align-items: center; gap: 4px; }
.jw-stop .jw-x { padding: 0 6px; }
.jw-stopgraph svg { display: block; width: 100%; height: 40px; border-radius: 4px; border: 1px solid var(--line2); background: rgba(0, 0, 0, .25); }
.jw-addstop { align-self: flex-start; }
.jw-color4 { display: flex; align-items: center; gap: 4px; }
.jw-color4 input[type=number] { width: 56px; }
/* a setting written as the page writes it (a readout's element and bindings): VFX editor */
.jw-json { width: 100%; box-sizing: border-box; font: 11px/1.35 ui-monospace, Consolas, monospace; background: #0d1017; color: #e2d3a6; border: 1px solid #38352f; border-radius: 4px; padding: 4px 6px; resize: vertical; }
.jw-json.bad { border-color: #8f4436; }
