/* Plain, monochrome, paper-like. Colour is reserved for status: red = missing audio, amber = outdated, green = done. */
:root {
  --paper: #f4f3ef; --dot: #cfcbc2; --panel: #ffffff; --ink: #1c1c1c; --ink2: #3d3b37; --muted: #77736a;
  --line: #dcd8cf; --line2: #b9b4a9; --sel: #1c1c1c; --link: #6b675e;
  --bad: #a8321f; --warn: #b4620f; --ok: #3d6b4f;
  --bad-bg: #fbeeea; --warn-bg: #fdf3e3; --ok-bg: #edf4ef;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; margin: 0; overflow: hidden; }
body { font: 13px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans TC", "Microsoft JhengHei", sans-serif; color: var(--ink); background: var(--paper); -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
svg.i { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.muted { color: var(--muted); }
.spacer { flex: 1; }

/* ---------- header ---------- */
#top { position: fixed; left: 0; right: 0; top: 0; height: 44px; display: flex; align-items: center; gap: 6px; padding: 0 10px; background: var(--panel); border-bottom: 1px solid var(--line); z-index: 30; }
.brand { display: flex; align-items: baseline; gap: 8px; margin-right: 8px; white-space: nowrap; }
.brand b { font-size: 14px; letter-spacing: .02em; }
.brand span { color: var(--muted); font-size: 12px; }
.hbtn { height: 28px; padding: 0 10px; border: 1px solid transparent; background: none; border-radius: 3px; display: inline-flex; align-items: center; gap: 6px; color: var(--ink); text-decoration: none; white-space: nowrap; }
.hbtn:hover { background: var(--paper); }
.hbtn.on { background: var(--ink); color: #fff; }
.hbtn .cnt:empty { display: none; }
.hbtn .cnt { font-size: 12px; color: var(--muted); }
.hbtn.on .cnt { color: #d8d4ca; }
.hbtn .cnt.bad { color: var(--bad); font-weight: 600; }
.hbtn.on .cnt.bad { color: #ffb4a6; }
#who { border-color: var(--line); }
.iconbtn { width: 28px; height: 28px; border: 0; background: none; border-radius: 3px; display: inline-grid; place-items: center; color: var(--ink); padding: 0; }
.iconbtn:hover:not(:disabled) { background: var(--paper); }
.iconbtn:disabled { opacity: .3; cursor: default; }
.sep { width: 1px; height: 18px; background: var(--line); margin: 0 4px; }
.search { position: relative; width: 220px; }
.search input { width: 100%; height: 28px; border: 1px solid var(--line); border-radius: 3px; padding: 0 44px 0 28px; background: var(--paper); }
.search input:focus { background: #fff; outline: none; border-color: var(--ink); }
.search .i { position: absolute; left: 8px; top: 6px; width: 15px; height: 15px; color: var(--muted); pointer-events: none; }
.search small { position: absolute; right: 8px; top: 5px; color: var(--muted); font-size: 12px; }

/* ---------- left tools ---------- */
#tools { position: fixed; left: 8px; top: 54px; width: 56px; padding: 4px 0; background: var(--panel); border: 1px solid var(--line); border-radius: 3px; z-index: 25; display: flex; flex-direction: column; }
.tool { border: 0; background: none; padding: 7px 0 5px; display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 11px; color: var(--ink2); user-select: none; }
.tool:hover { background: var(--paper); }
.tool.on { background: var(--ink); color: #fff; }
.tool.drop { background: var(--bad-bg); color: var(--bad); outline: 1px dashed var(--bad); }
.tool .i { width: 22px; height: 22px; }
#tools hr { border: 0; border-top: 1px solid var(--line); margin: 3px 8px; width: calc(100% - 16px); }

/* ---------- board ---------- */
#board { position: fixed; inset: 44px 0 0 0; overflow: hidden; background-color: var(--paper); background-image: radial-gradient(circle, var(--dot) 1px, transparent 1.2px); touch-action: none; cursor: grab; user-select: none; -webkit-user-select: none; }
#board.panning { cursor: grabbing; }
#board.arrowmode, #board.arrowmode .node { cursor: crosshair; }
#stage { position: absolute; left: 0; top: 0; transform-origin: 0 0; will-change: transform; user-select: none; -webkit-user-select: none; }
#links { position: absolute; left: 0; top: 0; width: 1px; height: 1px; overflow: visible; pointer-events: none; z-index: 1; }
#links path.line { fill: none; stroke: var(--link); stroke-width: 1.4; }
#links path.hit { fill: none; stroke: transparent; stroke-width: 16; pointer-events: stroke; cursor: pointer; }
#links g.sel path.line { stroke: var(--sel); stroke-width: 2.4; }
#links path.temp { fill: none; stroke: var(--sel); stroke-width: 1.8; stroke-dasharray: 6 4; }
.llabel { position: absolute; z-index: 3; transform: translate(-50%, -50%); background: var(--panel); border: 1px solid var(--line); border-radius: 2px; padding: 0 6px; font-size: 11px; line-height: 17px; color: var(--ink2); white-space: nowrap; cursor: pointer; user-select: none; -webkit-user-select: none; }
.llabel.sel { border-color: var(--sel); }
.llabel-in { position: absolute; z-index: 4; transform: translate(-50%, -50%); font-size: 11px; line-height: 17px; border: 1px solid var(--sel); background: #fff; padding: 0 6px; width: 140px; text-align: center; outline: 0; user-select: text; -webkit-user-select: text; }
#cards { position: absolute; left: 0; top: 0; z-index: 2; }

/* nodes: white blocks, the type is shown by a small caption and the outline */
.node { position: absolute; background: #fff; border: 1px solid var(--line2); border-radius: 3px; padding: 7px 10px 8px; font-size: 12.5px; line-height: 1.45; color: var(--ink); user-select: none; -webkit-user-select: none; touch-action: none; transition: opacity .15s; }
.node.t-phone { border-radius: 14px; border-color: var(--ink2); padding: 7px 14px 9px; }
.node.t-condition { border-style: dashed; }
.node.t-desc { border-color: var(--line); color: var(--ink2); }
.node.sel { outline: 2px solid var(--sel); outline-offset: 1px; z-index: 5; }
.node.dim { opacity: .18; }
.node.hit { outline: 2px solid var(--warn); outline-offset: 1px; }
.node.linktarget { outline: 2px solid var(--ok); }
.node .cap { display: flex; gap: 8px; align-items: baseline; font-size: 10.5px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); margin-bottom: 3px; }
.node .cap .st { margin-left: auto; letter-spacing: 0; text-transform: none; font-weight: 600; }
.node .cap .st.bad { color: var(--bad); }
.node .cap .st.warn { color: var(--warn); }
.node .name { font-weight: 650; overflow-wrap: anywhere; white-space: pre-wrap; }
.node .txt { white-space: pre-wrap; overflow-wrap: anywhere; }
.node .txt > div { min-height: 1em; }
.node .txt .red { color: #c0261a; }
.node .name + .txt { margin-top: 3px; color: var(--ink2); }
.node .empty { color: var(--muted); font-style: italic; }
.node .num { font-size: 17px; font-weight: 650; letter-spacing: .01em; }
.node .num small { font-size: 11px; font-weight: 600; color: var(--muted); margin-right: 5px; letter-spacing: .05em; }
.node .did { color: var(--ink2); font-size: 12px; }
.node .did small { font-size: 10.5px; color: var(--muted); font-weight: 600; letter-spacing: .05em; margin-right: 5px; }

/* audio block on a voice node */
.audio { margin-top: 8px; border-top: 1px solid var(--line); padding-top: 7px; }
.audio .play { display: flex; align-items: center; gap: 4px; }
.audio .bar { flex: 1; height: 4px; background: var(--line); position: relative; cursor: pointer; margin: 0 4px; border-radius: 2px; }
.audio .bar i { position: absolute; left: 0; top: 0; bottom: 0; background: var(--ink); width: 0; border-radius: 2px; }
.audio .time { font-size: 11px; color: var(--muted); min-width: 34px; text-align: right; font-variant-numeric: tabular-nums; }
.audio .fname { font-size: 11px; color: var(--muted); margin: 3px 0 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.audio .alert { font-size: 11.5px; font-weight: 600; margin: 0 0 6px; }
.audio .alert.none { color: var(--bad); }
.audio .alert.stale { color: var(--warn); }
.audio .alert button { margin-left: 6px; }
.audio .acts { display: flex; gap: 4px; margin-top: 6px; flex-wrap: wrap; }
.ibtn { width: 26px; height: 26px; border: 1px solid var(--line); background: #fff; border-radius: 3px; display: inline-grid; place-items: center; padding: 0; color: var(--ink); flex: none; }
.ibtn:hover { background: var(--paper); }
.ibtn .i { width: 15px; height: 15px; }
.ibtn.go { background: var(--ink); color: #fff; border-color: var(--ink); }
.tbtn { border: 1px solid var(--line2); background: #fff; border-radius: 3px; height: 24px; padding: 0 8px; font-size: 11.5px; display: inline-flex; align-items: center; gap: 4px; color: var(--ink); }
.tbtn:hover { background: var(--paper); }
.tbtn .i { width: 13px; height: 13px; }
.tbtn.rec { color: var(--bad); border-color: var(--bad); }
.tbtn.link { border-color: transparent; background: none; text-decoration: underline; padding: 0 4px; color: var(--ink2); }

/* notes and to-dos on a node */
.tasks { margin-top: 8px; border-top: 1px solid var(--line); }
.task { display: flex; gap: 7px; align-items: flex-start; padding: 5px 0 3px; }
.task + .task { border-top: 1px dotted var(--line); }
.task .tick { flex: none; width: 16px; height: 16px; border: 1.5px solid var(--ink2); background: #fff; border-radius: 2px; display: grid; place-items: center; padding: 0; color: #fff; margin-top: 2px; }
.task .tick:hover { border-color: var(--ok); }
.task .tick.on { background: var(--ok); border-color: var(--ok); }
.task .tick .i { width: 12px; height: 12px; stroke-width: 3; }
.task .dotn { flex: none; width: 16px; height: 16px; display: grid; place-items: center; margin-top: 2px; }
.task .dotn::before { content: ""; width: 5px; height: 5px; background: var(--muted); border-radius: 50%; }
.task .tb { flex: 1; min-width: 0; }
.task .tt { white-space: pre-wrap; overflow-wrap: anywhere; cursor: pointer; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.task.open .tt { -webkit-line-clamp: unset; display: block; }
.task.done .tt { color: var(--muted); text-decoration: line-through; }
.task .tm { font-size: 11px; color: var(--muted); }
.task .tm.ok { color: var(--ok); }
.task .del { border: 0; background: none; color: var(--muted); width: 18px; height: 18px; padding: 0; display: grid; place-items: center; opacity: 0; flex: none; }
.node:hover .task .del, .node.sel .task .del { opacity: 1; }
.task .del .i { width: 12px; height: 12px; }
.task .more { white-space: pre-wrap; font-size: 12px; background: #faf9f6; border: 1px solid var(--line); padding: 5px 7px; margin-top: 4px; }
.addrow { display: flex; gap: 4px; margin-top: 6px; }
.addrow input { flex: 1; min-width: 0; border: 1px solid var(--ink); border-radius: 3px; padding: 3px 7px; background: #fff; user-select: text; -webkit-user-select: text; }
.nfoot { display: flex; gap: 4px; margin-top: 8px; align-items: center; flex-wrap: wrap; }
.nfoot .by { margin-left: auto; font-size: 10.5px; color: var(--muted); }

/* the + button that extends the flow */
.plus { position: absolute; right: -13px; top: 50%; margin-top: -11px; width: 22px; height: 22px; border-radius: 50%; border: 1px solid var(--ink2); background: #fff; display: grid; place-items: center; padding: 0; z-index: 4; cursor: crosshair; touch-action: none; color: var(--ink); }
.plus:hover, .node.sel .plus { background: var(--ink); color: #fff; }
.plus .i { width: 13px; height: 13px; stroke-width: 2; pointer-events: none; }

/* editing form */
.node.editing { z-index: 6; user-select: text; -webkit-user-select: text; cursor: default; }
.node .lbl { display: block; font-size: 10.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin: 7px 0 2px; }
.node .seg { display: flex; border: 1px solid var(--line2); border-radius: 3px; overflow: hidden; margin: 2px 0; }
.node .seg button { flex: 1; border: 0; border-left: 1px solid var(--line2); background: #fff; padding: 3px 4px; font-size: 11.5px; }
.node .seg button:first-child { border-left: 0; }
.node .seg button.on { background: var(--ink); color: #fff; }
.node .fin { display: block; width: 100%; border: 1px solid var(--line2); border-radius: 2px; padding: 4px 6px; background: #fff; resize: none; overflow: hidden; font: inherit; }
.node .fin:focus { outline: 0; border-color: var(--ink); }
.node .fin.nm { font-weight: 650; }
.node .frm { display: flex; gap: 6px; margin-top: 10px; align-items: center; }
.node .frm .hint2 { color: var(--muted); font-size: 11px; margin-left: auto; }
.hist { margin-top: 8px; font-size: 12px; }
.hist .hrow { border-top: 1px solid var(--line); padding: 5px 0; }
.hist .hrow .m { color: var(--muted); font-size: 11px; display: flex; gap: 8px; align-items: center; }
.hist pre { margin: 2px 0 0; white-space: pre-wrap; font: inherit; max-height: 64px; overflow: auto; }

/* headings (free text) */
.node.t-label { background: none; border: 1px dashed transparent; padding: 2px 4px; border-radius: 2px; }
.node.t-label:hover, .node.t-label.sel { border-color: var(--line2); }
.node.t-label .name { font-weight: 600; }
.node.t-label.h1 .name { font-size: 22px; letter-spacing: .01em; }
.node.t-label.h2 .name { font-size: 15px; letter-spacing: .08em; color: var(--muted); }
.node.t-label .plus { display: none; }

/* selection toolbar */
#ctx { position: fixed; z-index: 28; background: var(--panel); border: 1px solid var(--line2); border-radius: 3px; box-shadow: 0 2px 8px rgba(0,0,0,.12); padding: 3px; display: flex; gap: 1px; align-items: center; }
#ctx .cbtn { height: 28px; border: 0; background: none; border-radius: 2px; padding: 0 9px; display: inline-flex; align-items: center; gap: 6px; font-size: 12px; }
#ctx .cbtn:hover { background: var(--paper); }
#ctx .cbtn.on { background: var(--ink); color: #fff; }
#ctx .cbtn .i { width: 15px; height: 15px; }

/* zoom, hint, filter bar */
#zoom { position: fixed; left: 8px; bottom: 10px; z-index: 20; display: flex; align-items: center; background: var(--panel); border: 1px solid var(--line); border-radius: 3px; }
.zpct { min-width: 54px; height: 28px; border: 0; border-left: 1px solid var(--line); border-right: 1px solid var(--line); background: none; font-size: 12px; margin: 0 2px; }
.zpct:hover { background: var(--paper); }
#hint { position: fixed; left: 50%; top: 56px; transform: translateX(-50%); z-index: 22; background: var(--ink); color: #fff; padding: 6px 14px; border-radius: 3px; font-size: 12px; pointer-events: none; opacity: 0; transition: opacity .2s; max-width: 92vw; text-align: center; }
#hint.show { opacity: 1; }
#filterBar { position: fixed; left: 50%; bottom: 14px; transform: translateX(-50%); z-index: 22; background: var(--ink); color: #fff; border-radius: 3px; padding: 4px 6px 4px 14px; display: flex; gap: 6px; align-items: center; }
#filterBar button { border: 0; background: none; color: #fff; height: 26px; padding: 0 8px; border-radius: 2px; }
#filterBar button:hover { background: #3a3a37; }

/* buttons, popovers, dialogs */
.btn { border: 1px solid var(--line2); background: #fff; border-radius: 3px; padding: 0 11px; height: 28px; display: inline-flex; align-items: center; gap: 6px; text-decoration: none; color: var(--ink); white-space: nowrap; font-size: 12.5px; }
.btn:hover { background: var(--paper); }
.btn.primary { background: var(--ink); color: #fff; border-color: var(--ink); }
.btn.primary:hover { background: #000; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.small { height: 24px; padding: 0 8px; font-size: 12px; }
.empty-msg { color: var(--muted); text-align: center; padding: 22px 10px; }
.pop { position: fixed; z-index: 40; background: var(--panel); border: 1px solid var(--line2); border-radius: 3px; box-shadow: 0 4px 14px rgba(0,0,0,.14); padding: 3px; min-width: 200px; max-width: 340px; max-height: 70vh; overflow: auto; }
.pop button, .pop a { display: flex; width: 100%; align-items: center; gap: 10px; padding: 6px 10px; border: 0; background: none; text-align: left; color: var(--ink); text-decoration: none; border-radius: 2px; }
.pop button:hover, .pop a:hover { background: var(--paper); }
.pop hr { border: 0; border-top: 1px solid var(--line); margin: 3px 0; }
.pop .ptitle { padding: 5px 10px; color: var(--muted); font-size: 11.5px; }
.pop .trow { display: flex; align-items: center; gap: 8px; padding: 4px 8px; }
.pop .trow span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pop .trow .btn { width: auto; }
.pop.chooser { min-width: 270px; padding: 4px; }
.pop.chooser button { flex-direction: column; align-items: flex-start; gap: 0; padding: 8px 10px; }
.pop.chooser button b { font-weight: 650; }
.pop.chooser button span { color: var(--muted); font-size: 12px; }
.modal { position: fixed; inset: 0; background: rgba(20,20,18,.45); display: none; place-items: center; z-index: 50; padding: 16px; }
.modal.show { display: grid; }
#codeModal { z-index: 55; }
.dlg { background: var(--panel); border-radius: 3px; padding: 20px 22px; max-width: 440px; width: 100%; box-shadow: 0 10px 40px rgba(0,0,0,.3); max-height: 90vh; overflow: auto; }
.dlg.wide { max-width: 620px; }
.dlg h2 { margin: 0 0 8px; font-size: 16px; font-weight: 650; }
.dlg input[type=text], .dlg input:not([type]), .dlg input[type=password] { width: 100%; border: 1px solid var(--line2); border-radius: 3px; padding: 7px 9px; margin: 8px 0 10px; background: #fff; }
.dlg textarea { width: 100%; min-height: 54px; resize: vertical; border: 1px solid var(--line2); border-radius: 3px; padding: 6px 8px; background: #fff; }
.dlg .actions { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; margin-top: 12px; }
.err { color: var(--bad); font-size: 12.5px; margin-top: 6px; }
.tips { margin: 10px 0; }
.tips dt { font-weight: 650; margin-top: 10px; }
.tips dd { margin: 2px 0 0; color: var(--ink2); }
.keys { font-size: 12px; color: var(--muted); line-height: 2; margin: 12px 0 0; }
kbd { background: var(--paper); border: 1px solid var(--line2); border-radius: 2px; padding: 0 5px; font: 11px ui-monospace, monospace; }
.doctext { font-size: 13px; line-height: 1.6; }
.doctext > div { min-height: 1em; }
.tabs2 { display: flex; gap: 4px; margin: 6px 0 10px; }
.tabs2 button { border: 1px solid var(--line2); background: #fff; border-radius: 3px; padding: 0 10px; height: 26px; }
.tabs2 button.on { background: var(--ink); color: #fff; border-color: var(--ink); }
.ev { padding: 7px 0; border-bottom: 1px solid var(--line); display: flex; gap: 10px; }
.ev.go { cursor: pointer; }
.ev.go:hover { background: #faf9f6; }
.ev .when { color: var(--muted); font-size: 11.5px; flex: none; width: 96px; }
.ev .what { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.ev.handoff { font-weight: 650; }
.vrec { border: 1px solid var(--line); padding: 8px 10px; margin-bottom: 8px; }
.vrec .t { font-size: 12.5px; margin: 2px 0 6px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; white-space: pre-wrap; color: var(--ink2); }
.vver { display: flex; align-items: center; gap: 8px; margin-top: 5px; }
.vver audio { height: 30px; flex: 1; min-width: 0; }
.vver span { font-size: 11.5px; color: var(--muted); min-width: 88px; }
#toast { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%) translateY(16px); background: var(--ink); color: #fff; padding: 8px 14px; border-radius: 3px; opacity: 0; transition: .2s; z-index: 70; max-width: 92vw; display: flex; gap: 14px; align-items: center; pointer-events: none; }
#toast.show { opacity: 1; transform: translateX(-50%); pointer-events: auto; }
#toast button { border: 0; background: none; color: #f1c27a; font-weight: 700; padding: 0; }

@media (max-width: 860px) {
  .brand, #ragicLink, #undo, #redo, .sep, #btnJump { display: none; }
  .search { width: auto; flex: 1; }
  #whoName { max-width: 70px; overflow: hidden; text-overflow: ellipsis; }
  #tools { width: 48px; top: 50px; }
  .tool { font-size: 10px; padding: 5px 0 3px; }
  .tool .i { width: 19px; height: 19px; }
}
@media print { #top, #tools, #zoom, #ctx, #filterBar { display: none; } }

/* v3: drag handle, multi-select, views, minimap, save state */
.views { display: inline-flex; border: 1px solid var(--line); border-radius: 3px; overflow: hidden; margin-left: 6px; }
.views button { border: 0; border-left: 1px solid var(--line); background: #fff; height: 26px; padding: 0 10px; font-size: 12px; }
.views button:first-child { border-left: 0; }
.views button:hover { background: var(--paper); }
.views button.on { background: var(--ink); color: #fff; }
.save { font-size: 12px; color: var(--muted); min-width: 110px; text-align: right; white-space: nowrap; }
.save.busy { color: var(--ink2); }
.save.err { color: var(--bad); font-weight: 600; }
.node { --px: 10px; --py: 7px; }
.node.t-phone { --px: 14px; }
.node:not(.t-label):not(.editing) .cap { margin: calc(var(--py) * -1) calc(var(--px) * -1) 4px; padding: 5px var(--px) 3px; background: #f7f6f2; border-bottom: 1px solid var(--line); border-radius: 3px 3px 0 0; cursor: grab; }
.node.t-phone:not(.editing) .cap { border-radius: 13px 13px 0 0; }
.node:not(.t-label):not(.editing) .cap:active { cursor: grabbing; }
.node.t-label { cursor: grab; }
.node.multi { outline: 2px solid var(--sel); outline-offset: 1px; background: #fbfaf7; }
#marquee { position: fixed; z-index: 24; border: 1px dashed var(--ink); background: rgba(28,28,28,.05); pointer-events: none; }
#minimap { position: fixed; right: 10px; bottom: 10px; z-index: 20; width: 220px; height: 140px; background: var(--panel); border: 1px solid var(--line2); border-radius: 3px; cursor: pointer; }
@media (max-width: 860px) { .views, .save { display: none; } #minimap { display: none; } }

/* v4: open to-dos stand out, missing numbers stand out, key press nodes */
.node.has-todo { border-color: var(--warn); border-width: 2px; }
.node .cap .st.todo { color: #fff; background: var(--warn); padding: 0 6px; border-radius: 2px; font-weight: 700; margin-left: auto; }
.node .cap .st.todo + .st { margin-left: 6px; }
.node .cap .st { margin-left: auto; }
.task:not(.done):not(.note) { }
.tasks .task.open-item, .tasks .task:not(.done) .tick { }
.task:not(.done) .tick:not(.on) { border-color: var(--warn); }
.task:not(.done):has(.tick) { background: var(--warn-bg); margin: 0 -10px; padding: 6px 10px 4px; border-left: 4px solid var(--warn); }
.task:not(.done):has(.tick) .tt { font-weight: 600; -webkit-line-clamp: 4; }
.task:not(.done):has(.tick) .tm { color: var(--warn); font-weight: 600; }
.node.no-number { border-color: var(--bad); border-style: dashed; }
.node .num.miss { font-size: 12px; font-weight: 700; color: var(--bad); background: var(--bad-bg); padding: 2px 6px; border-radius: 2px; display: inline-block; margin-top: 3px; }
.keyrow { display: flex; gap: 10px; align-items: center; }
.keyb { flex: none; min-width: 34px; height: 34px; border: 2px solid var(--ink); border-radius: 4px; display: grid; place-items: center; font-size: 18px; font-weight: 700; padding: 0 6px; background: #fff; box-shadow: 0 2px 0 var(--ink); }
.keyb.miss { border-color: var(--bad); color: var(--bad); box-shadow: 0 2px 0 var(--bad); }
.node.t-key { border-radius: 8px; }
#nTodo.warnc { color: var(--warn); font-weight: 700; }
#fTodo:not(.on) { color: var(--ink); }
.node .cap .st + .st { margin-left: 6px; }
.search { width: 170px; } .save { min-width: 0; } .views { flex: none; } .hbtn { padding: 0 8px; }
.node .cap .st { white-space: nowrap; }

/* dialogs: close button always reachable */
.dlg { position: relative; }
.dlg > .mclose { position: sticky; top: 0; float: right; margin: -10px -12px 0 8px; width: 32px; height: 32px; border: 1px solid var(--line2); background: #fff; border-radius: 3px; display: grid; place-items: center; z-index: 3; }
.dlg > .mclose:hover { background: var(--paper); }
.dlg > .mclose[hidden] { display: none; }
.dlg .actions { position: sticky; bottom: -20px; background: #fff; padding: 10px 0 4px; border-top: 1px solid var(--line); z-index: 2; }
.dlg h2 { padding-right: 40px; }

/* header never overflows: less important items step aside on narrower screens */
#top { overflow: hidden; }
.search { flex: 0 1 170px; min-width: 90px; }
@media (max-width: 1500px) { .brand span { display: none; } }
@media (max-width: 1400px) { #ragicLink, .save { display: none; } }
@media (max-width: 1260px) { .views { display: none; } .search { flex-basis: 130px; } }
@media (max-width: 1000px) { .brand { display: none; } }

/* layout lock */
#board.locked .node:not(.editing) .cap, #board.locked .node.t-label { cursor: default; }
.tool#toolLock .i { width: 22px; height: 22px; }

/* phones: only search, menu and name stay in the top bar; filters live in the menu */
@media (max-width: 860px) {
  .flt, .views { display: none !important; }
  #top { gap: 4px; padding: 0 6px; }
  .search { flex: 1 1 auto; }
  #btnMenu { display: inline-grid !important; }
}

/* True / False exits of a condition */
#links g.tr path.line { stroke: var(--ok); stroke-width: 2; }
#links g.fa path.line { stroke: var(--bad); stroke-width: 2; }
#links g.sel path.line { stroke: var(--sel); }
.llabel.tr { color: #fff; background: var(--ok); border-color: var(--ok); font-weight: 600; }
.llabel.fa { color: #fff; background: var(--bad); border-color: var(--bad); font-weight: 600; }
.pop.chooser button.branchbtn b { }
.pop.chooser button.tr b { color: var(--ok); }
.pop.chooser button.fa b { color: var(--bad); }

/* unlocked: the whole node is the handle */
#board:not(.locked) .node:not(.editing) { cursor: grab; }
#board:not(.locked) .node:not(.editing):active { cursor: grabbing; }
#board:not(.locked) .node:not(.editing) .tt, #board:not(.locked) .node:not(.editing) .cap { cursor: inherit; }
#board.locked .node:not(.editing) { cursor: default; }

/* selecting a node never changes its size: the extra buttons float just below it */
.nfoot { position: absolute; left: -1px; top: 100%; margin-top: 5px; z-index: 7; background: #fff; border: 1px solid var(--line2); border-radius: 3px; padding: 4px; box-shadow: 0 2px 8px rgba(0,0,0,.12); flex-wrap: wrap; width: max-content; max-width: 420px; }
.nfoot .by { margin-left: 8px; white-space: nowrap; }
.task.done .tt { -webkit-line-clamp: 1; }
.task.done { padding: 3px 0 1px; }

/* resize handle (only while unlocked and selected) */
.node .rz { position: absolute; width: 12px; height: 12px; background: #fff; border: 2px solid var(--ink); border-radius: 2px; z-index: 8; touch-action: none; }
.node .rz.se { right: -7px; bottom: -7px; cursor: nwse-resize; }
.node .rz.nw { left: -7px; top: -7px; cursor: nwse-resize; }
.node .rz.ne { right: -7px; top: -7px; cursor: nesw-resize; }
.node .rz.sw { left: -7px; bottom: -7px; cursor: nesw-resize; }
.node .rz:hover { background: var(--ink); }
.node .rz::after { content: ""; position: absolute; inset: -10px; }

/* unlocked state is unmistakable: amber frame, banner and button */
#board.movemode { box-shadow: inset 0 0 0 4px var(--warn); }
#moveBanner { position: fixed; left: 50%; top: 54px; transform: translateX(-50%); z-index: 27; background: var(--warn); color: #fff; padding: 6px 8px 6px 14px; border-radius: 3px; font-size: 12.5px; font-weight: 600; display: flex; gap: 10px; align-items: center; max-width: 94vw; box-shadow: 0 2px 8px rgba(0,0,0,.2); }
#moveBanner button { border: 0; background: #fff; color: var(--warn); border-radius: 2px; height: 24px; padding: 0 10px; font-weight: 700; }
.tool#toolLock.moving { background: var(--warn); color: #fff; }
.tool#toolLock:not(.moving) { color: var(--ink2); }

/* arrow preview, locked tools */
#links path.temp { stroke: var(--sel); stroke-width: 2; stroke-dasharray: 7 5; fill: none; }
#board.locked ~ #tools, .tool.needs-unlock { }
.tool.dim { opacity: .45; }

/* locked: pure viewing, no selection, no text selection or callouts that could interrupt a drag */
#board.locked, #board.locked * { -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; -webkit-tap-highlight-color: transparent; }
#board.locked .node, #board.locked .llabel { cursor: grab; }
#board.locked.panning, #board.locked.panning * { cursor: grabbing; }
#board.locked #links path.hit { pointer-events: none; }
@media (max-width: 860px) { .task .tt { -webkit-line-clamp: 1; } .task:not(.done):has(.tick) .tt { -webkit-line-clamp: 1; } .task.open .tt { -webkit-line-clamp: unset; } }

/* ===== phones: bottom toolbar (like Miro and FigJam), bottom sheet for details and editing, big touch targets ===== */
.tool.mob { display: none; }
#sheet { position: fixed; left: 0; right: 0; bottom: 0; z-index: 45; max-height: 64vh; overflow: auto; background: #fff; border-radius: 16px 16px 0 0; box-shadow: 0 -6px 24px rgba(0,0,0,.22); padding: 0 14px calc(16px + env(safe-area-inset-bottom)); overscroll-behavior: contain; }
.sh-head { position: sticky; top: 0; background: #fff; display: flex; align-items: center; gap: 10px; padding: 12px 0 10px; border-bottom: 1px solid var(--line); z-index: 2; }
.sh-head::before { content: ""; position: absolute; left: 50%; top: 5px; width: 38px; height: 4px; margin-left: -19px; border-radius: 2px; background: var(--line2); }
.sh-title { flex: 1; min-width: 0; padding-top: 6px; }
.sh-title small { display: block; font-size: 11px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); }
.sh-title b { display: block; font-size: 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sh-x { flex: none; width: 44px; height: 44px; border: 0; background: var(--paper); border-radius: 50%; display: grid; place-items: center; }
.sh-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 12px 0; }
.sbtn { min-height: 48px; border: 1px solid var(--line2); background: #fff; border-radius: 10px; font-size: 14px; display: flex; align-items: center; justify-content: center; gap: 6px; padding: 0 10px; color: var(--ink); }
.sbtn:active { background: var(--paper); }
.sbtn.primary { background: var(--ink); color: #fff; border-color: var(--ink); }
.sbtn.danger { color: var(--bad); border-color: #e4c3bb; }
.sbtn.tr { color: #fff; background: var(--ok); border-color: var(--ok); }
.sbtn.fa { color: #fff; background: var(--bad); border-color: var(--bad); }
.sbtn.small { min-height: 36px; font-size: 13px; margin-left: 8px; }
.sbtn .i { width: 20px; height: 20px; }
.sh-add { display: flex; gap: 8px; margin: 4px 0 12px; }
.sh-add input, .sh-form .fin { font-size: 16px; min-height: 46px; border: 1px solid var(--ink); border-radius: 10px; padding: 8px 12px; flex: 1; min-width: 0; background: #fff; width: 100%; }
.sh-sec h4 { margin: 14px 0 6px; font-size: 12px; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); }
.sh-warn { font-weight: 600; margin: 4px 0 8px; display: flex; align-items: center; flex-wrap: wrap; }
.sh-warn.bad { color: var(--bad); } .sh-warn.warn { color: var(--warn); }
.sh-play { display: grid; grid-template-columns: 1.2fr 1fr 1fr; gap: 8px; }
.sh-meta { font-size: 12px; color: var(--muted); margin: 4px 0; }
.sh-task { display: flex; gap: 12px; align-items: flex-start; padding: 10px 0; border-top: 1px solid var(--line); }
.sh-tick { flex: none; width: 40px; height: 40px; border: 2px solid var(--ink2); border-radius: 8px; background: #fff; display: grid; place-items: center; color: #fff; padding: 0; }
.sh-tick.on { background: var(--ok); border-color: var(--ok); }
.sh-tick .i { width: 22px; height: 22px; stroke-width: 3; }
.sh-dot { flex: none; width: 40px; height: 40px; display: grid; place-items: center; }
.sh-dot::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--muted); }
.sh-tb { flex: 1; min-width: 0; }
.sh-tt { font-size: 15px; white-space: pre-wrap; overflow-wrap: anywhere; }
.sh-task.done .sh-tt { color: var(--muted); text-decoration: line-through; }
.sh-more { white-space: pre-wrap; font-size: 13px; background: var(--paper); border-radius: 8px; padding: 8px 10px; margin-top: 6px; }
.sh-del { flex: none; width: 40px; height: 40px; border: 0; background: none; color: var(--muted); display: grid; place-items: center; }
.sh-form { padding: 6px 0 4px; }
.sh-form .lbl { display: block; font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin: 12px 0 4px; }
.sh-form .seg { display: flex; border: 1px solid var(--line2); border-radius: 10px; overflow: hidden; margin: 8px 0; }
.sh-form .seg button { flex: 1; min-height: 44px; border: 0; border-left: 1px solid var(--line2); background: #fff; font-size: 14px; }
.sh-form .seg button:first-child { border-left: 0; }
.sh-form .seg button.on { background: var(--ink); color: #fff; }
.sh-form .frm { display: flex; gap: 10px; margin-top: 16px; align-items: center; flex-wrap: wrap; }
.sh-form .frm .btn { height: 48px; flex: 1; justify-content: center; font-size: 15px; border-radius: 10px; }
.sh-form .hint2 { display: none; }
.sh-form .tbtn.link { height: 44px; }
.sh-form .hist { margin-top: 12px; }

@media (max-width: 860px) {
  #tools { left: 0; right: 0; top: auto; bottom: 0; width: auto; flex-direction: row; justify-content: space-around; border-radius: 0; border-width: 1px 0 0; padding: 4px 2px calc(4px + env(safe-area-inset-bottom)); z-index: 40; }
  #tools hr { display: none; }
  .tool { flex: 1; min-height: 52px; font-size: 11px; justify-content: center; }
  .tool .i { width: 24px; height: 24px; }
  .tool.mob { display: flex; }
  #toolArrow { display: none; }
  #zoom { bottom: 70px; left: 8px; }
  #filterBar { bottom: 80px; }
  #moveBanner { top: 50px; font-size: 12px; max-width: 96vw; }
  body.sheet-open:not(.sheet-side) #tools, body.sheet-open:not(.sheet-side) #zoom, body.sheet-open:not(.sheet-side) #arrBar { display: none; }
  body.sheet-open:not(.sheet-side) #filterBar { bottom: calc(var(--sheet-h, 300px) + 8px); }
  body.sheet-open:not(.sheet-side) #board { bottom: 0; }   /* the sheet floats over the board, so there is never an empty band between them */
  #board { bottom: 62px; }
  #board.movemode { box-shadow: inset 0 0 0 3px var(--warn); }
  /* in-block controls are tiny on a phone: everything goes through the sheet instead */
  #board:not(.locked) .node .plus, #board:not(.locked) .node .rz, .nfoot, .node .audio .acts, .node .task .del { display: none !important; }
  input, textarea, select { font-size: 16px; }
  .dlg { padding: 18px 16px; }
  .pop button, .pop a { min-height: 44px; }
  .pop.chooser button { min-height: 56px; }
  .hbtn { height: 36px; }
  .iconbtn { width: 40px; height: 40px; }
}


/* arrange: preview bar */
#arrBar { position: fixed; left: 50%; bottom: 16px; transform: translateX(-50%); z-index: 60; background: var(--ink); color: #fff; border-radius: 4px; padding: 8px 8px 8px 14px; display: flex; gap: 10px; align-items: center; max-width: min(760px, 96vw); box-shadow: 0 4px 16px rgba(0,0,0,.3); }
#arrBar .am { font-size: 12.5px; line-height: 1.45; min-width: 0; }
#arrBar .am span { color: #ddd9cf; }
#arrBar .btn { flex: none; border-color: #fff; }
#arrBar .btn.primary { background: #fff; color: var(--ink); }
#arrBar .btn:not(.primary) { background: transparent; color: #fff; }
body.arranging #tools .tool { pointer-events: none; opacity: .45; }
@media (max-width: 860px) { #arrBar { bottom: 70px; flex-wrap: wrap; width: calc(100vw - 16px); } #arrBar .btn { height: 40px; flex: 1; justify-content: center; } #arrBar .am { flex-basis: 100%; } }
.node .tmore { font-size: 11px; color: var(--muted); padding: 4px 0 1px; border-top: 1px dotted var(--line); cursor: pointer; }
.node .tmore:hover { color: var(--ink); text-decoration: underline; }

/* block details: chips, readable content, side panel on desktop and on a phone held sideways */
.sh-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 0; }
.chip { font-size: 12px; font-weight: 600; padding: 2px 9px; border-radius: 11px; border: 1px solid var(--line2); background: #fff; color: var(--ink2); white-space: nowrap; }
.chip.bad { color: var(--bad); border-color: #e4c3bb; background: var(--bad-bg); }
.chip.warn { color: var(--warn); border-color: #ecd3a8; background: var(--warn-bg); }
.chip.ok { color: var(--ok); border-color: #bcd5c4; background: var(--ok-bg); }
.sh-read { margin: 12px 0 4px; }
.sh-read .rt { font-weight: 650; font-size: 16px; overflow-wrap: anywhere; }
.sh-read .rb { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 15px; color: var(--ink2); margin-top: 4px; line-height: 1.55; }
.sh-read .rb .red { color: #c0261a; }
.sh-read .rb > div { min-height: 1em; }
.sh-note { font-size: 13px; color: var(--ink2); background: var(--paper); border-radius: 8px; padding: 10px 12px; margin: 4px 0 12px; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.node.opened { box-shadow: 0 0 0 2px var(--ink2); }
.sh-form .frm { position: sticky; bottom: calc(-16px - env(safe-area-inset-bottom)); background: #fff; padding: 10px 0 calc(8px + env(safe-area-inset-bottom)); margin-top: 12px; border-top: 1px solid var(--line); z-index: 3; }
#sheet { max-height: min(72vh, calc(var(--vvh, 100vh) * .82)); }
@media (min-width: 861px), (max-height: 500px) and (orientation: landscape) {
  #sheet { left: auto; top: 44px; right: 0; bottom: 0; width: 380px; max-height: none; border-radius: 0; box-shadow: -4px 0 18px rgba(0,0,0,.14); border-left: 1px solid var(--line); }
  body.sheet-side .sh-head::before { display: none; }
}
@media (min-width: 861px) {
  .sbtn { min-height: 38px; font-size: 13px; border-radius: 5px; }
  .sbtn .i { width: 17px; height: 17px; }
  .sh-x { width: 34px; height: 34px; }
  .sh-tick, .sh-dot, .sh-del { width: 32px; height: 32px; }
  .sh-tt { font-size: 13.5px; }
  .sh-read .rb { font-size: 13.5px; }
  .sh-add input, .sh-form .fin { font-size: 13.5px; min-height: 36px; border-radius: 4px; }
  .sh-form .seg { border-radius: 4px; } .sh-form .seg button { min-height: 34px; font-size: 13px; }
  .sh-form .frm .btn { height: 36px; border-radius: 5px; font-size: 13px; }
}
/* a phone held sideways: the tools become a column on the left, the details a panel on the right */
@media (max-width: 860px) and (max-height: 500px) and (orientation: landscape) {
  #tools { left: 0; right: auto; top: 44px; bottom: 0; width: 54px; flex-direction: column; justify-content: flex-start; overflow-y: auto; border-width: 0 1px 0 0; padding: 2px 0; }
  .tool { flex: none; min-height: 48px; }
  #board { bottom: 0; }
  #zoom { left: 62px; bottom: 8px; right: auto; flex-direction: row; }
  #filterBar { bottom: 8px; left: 130px; right: 60px; transform: none; }
  #arrBar { bottom: 8px; left: 62px; transform: none; width: auto; max-width: calc(100vw - 72px); }
  #moveBanner { top: 48px; }
  body.sheet-side #filterBar, body.sheet-side #arrBar { right: 392px; }
}

/* outline list (the way around the flow on a phone) */
#btnList { display: inline-grid; }
#listPanel { position: fixed; z-index: 46; top: 44px; bottom: 0; left: 0; width: 380px; background: #fff; border-right: 1px solid var(--line2); box-shadow: 4px 0 18px rgba(0,0,0,.14); display: flex; flex-direction: column; padding: 0 12px 0; }
#listPanel[hidden] { display: none !important; }
.l-head { display: flex; align-items: center; justify-content: space-between; padding: 10px 0 6px; }
.l-head b { font-size: 15px; }
#lq { width: 100%; height: 38px; border: 1px solid var(--line2); border-radius: 6px; padding: 0 10px; background: var(--paper); font-size: 16px; }
#lq:focus { outline: none; border-color: var(--ink); background: #fff; }
.l-chips { display: flex; gap: 6px; overflow-x: auto; padding: 8px 0 4px; scrollbar-width: none; flex: none; }
.l-chips::-webkit-scrollbar { display: none; }
.lchip { flex: none; height: 32px; padding: 0 12px; border: 1px solid var(--line2); background: #fff; border-radius: 16px; font-size: 13px; }
.lchip.on { background: var(--ink); color: #fff; border-color: var(--ink); }
.l-count { font-size: 12px; color: var(--muted); padding: 2px 2px 6px; flex: none; }
.l-body { flex: 1; overflow-y: auto; margin: 0 -12px; padding-bottom: calc(16px + env(safe-area-inset-bottom)); overscroll-behavior: contain; }
.l-group { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; justify-content: space-between; background: var(--paper); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 6px 14px; font-size: 11.5px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); }
.l-map { border: 1px solid var(--line2); background: #fff; border-radius: 12px; height: 26px; padding: 0 10px; font-size: 12px; letter-spacing: 0; text-transform: none; font-weight: 600; color: var(--ink); }
.lrow { display: flex; align-items: center; gap: 8px; width: 100%; min-height: 48px; border: 0; border-bottom: 1px solid var(--line); background: #fff; text-align: left; padding: 6px 14px 6px 14px; color: var(--ink); }
.lrow:hover, .lrow:active { background: var(--paper); }
.lcap { flex: none; min-width: 48px; font-size: 10.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.ltx { flex: 1; min-width: 0; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lst { flex: none; display: flex; gap: 4px; }
.lst .chip { font-size: 11px; padding: 1px 7px; }
body.list-open #filterBar { display: none; }
#backChip { position: fixed; z-index: 47; left: 50%; top: 54px; transform: translateX(-50%); height: 38px; padding: 0 16px; border: 0; border-radius: 19px; background: var(--ink); color: #fff; font-size: 14px; box-shadow: 0 3px 12px rgba(0,0,0,.3); }
#backChip[hidden] { display: none; }
#filterBar { max-width: calc(100vw - 16px); }
#filterBar .fb-t { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 46vw; }
@media (min-width: 861px) { #btnList { display: none; } }
@media (max-width: 860px) {
  #listPanel { left: 0; right: 0; width: auto; border-right: 0; box-shadow: none; }
  #btnList { display: inline-grid !important; }
  #zoom { right: 8px; left: auto; bottom: 70px; flex-direction: column; }
  #zoom .zpct { min-width: 0; width: 40px; height: 34px; border: 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); margin: 2px 0; }
  #filterBar { left: 8px; right: 60px; bottom: 70px; transform: none; justify-content: space-between; padding: 4px 4px 4px 12px; }
  #filterBar button { height: 36px; min-width: 36px; font-size: 15px; }
}
@media (max-width: 860px) and (max-height: 500px) and (orientation: landscape) {
  #listPanel { left: 54px; width: 340px; right: auto; box-shadow: 4px 0 18px rgba(0,0,0,.14); }
  #zoom { right: 8px; left: auto; bottom: 8px; flex-direction: row; }
  #zoom .zpct { width: 44px; height: 28px; border: 0; border-left: 1px solid var(--line); border-right: 1px solid var(--line); margin: 0 2px; }
  #filterBar { left: 130px; right: 150px; bottom: 8px; }
}

body.sheet-side #filterBar { left: calc((100vw - 380px) / 2); }
@media (max-width: 860px) { body.sheet-side #filterBar { left: 130px; } }
@media (max-width: 860px) and (max-height: 500px) and (orientation: landscape) {
  #filterBar { right: 190px; }
  body.sheet-side #zoom { display: none; }
  body.sheet-side #filterBar { right: 392px; }
}
body.sheet-side #backChip { left: calc((100vw - 380px) / 2); }
#backChip { white-space: nowrap; font-size: 13px; height: 34px; }

/* audio details and the Ragic picker */
.sh-grid2 { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 2px; }
.sh-grid2 .sbtn { min-height: 38px; font-size: 13px; text-decoration: none; }
.sh-warn .sh-grid2 { width: 100%; }
.sh-play { grid-template-columns: 1.2fr 1fr 1fr; }
.sh-old { margin: 10px 0 4px; border-top: 1px solid var(--line); padding-top: 6px; }
.sh-old summary { cursor: pointer; font-size: 13px; color: var(--ink2); padding: 6px 0; }
.sh-oldrow { padding: 6px 0; border-top: 1px dotted var(--line); }
.rg-tools { display: flex; gap: 6px; margin: 4px 0 10px; }
.vrec .vh { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.vrec .vh a { font-size: 12px; }
.vver { display: block; border-top: 1px dotted var(--line); padding: 8px 0 4px; margin-top: 6px; }
.vver .vtop { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.vver .vat { font-size: 12px; color: var(--ink2); min-width: 0; }
.vver .vfile { font-size: 11.5px; color: var(--muted); overflow-wrap: anywhere; }
.vver .vstate { font-size: 12px; color: var(--muted); margin: 4px 0; }
.vver .vstate.bad { color: var(--bad); }
.vver .vstate.ok { color: var(--ok); }
.vver .vbtns { display: flex; gap: 8px; flex-wrap: wrap; }
.vver[hidden] { display: none; }
@media (max-width: 860px) { .vver .btn { height: 40px; } .rg-tools .lchip { height: 36px; } }
.vver .chip { min-width: 0; }
.sh-hand { font-weight: 650; font-size: 14px; margin: 2px 0; }
.sh-hand.warn { color: var(--warn); } .sh-hand.ok { color: var(--ok); }
.pop { z-index: 48; }
@media (max-width: 860px) { body.arranging #zoom, body.arranging #filterBar { display: none; } }

/* select mode */
#board.selmode { cursor: crosshair; }
#board.selmode .node:not(.editing) { cursor: pointer; }
#selBar { position: fixed; left: 50%; bottom: 16px; transform: translateX(-50%); z-index: 59; background: var(--ink); color: #fff; border-radius: 4px; padding: 6px 8px 6px 14px; display: flex; gap: 4px; align-items: center; flex-wrap: wrap; max-width: min(820px, 96vw); box-shadow: 0 4px 16px rgba(0,0,0,.3); }
#selBar[hidden] { display: none; }
#selBar .sb-n { font-weight: 650; margin-right: 8px; font-size: 13px; white-space: nowrap; }
#selBar button { border: 0; background: none; color: #fff; height: 30px; padding: 0 9px; border-radius: 3px; font-size: 12.5px; }
#selBar button:hover { background: #3a3a37; }
#selBar button.danger { color: #ffb4a6; }
#selBar button.done { background: #fff; color: var(--ink); font-weight: 650; }
.node.multi { background: #fbfaf7; box-shadow: 0 0 0 3px rgba(28,28,28,.15); }
@media (max-width: 860px) {
  #selBar { bottom: 70px; left: 8px; right: 8px; transform: none; max-width: none; padding: 6px; }
  #selBar button { height: 40px; padding: 0 12px; font-size: 14px; }
  body.sheet-open:not(.sheet-side) #selBar { display: none; }
  .tool { font-size: 10.5px; }
}
@media (max-width: 860px) and (max-height: 500px) and (orientation: landscape) { #selBar { left: 62px; right: 8px; bottom: 8px; } }
body.arranging #selBar { display: none; }
.tool#toolArrange.auto::after { content: "AUTO"; position: absolute; top: 2px; right: 3px; font-size: 8px; font-weight: 700; letter-spacing: .04em; color: #fff; background: var(--ok); border-radius: 2px; padding: 0 3px; line-height: 12px; }
.tool { position: relative; }

/* True / False sides: the blocks a condition leads to are tinted so the two paths are easy to tell apart */
.node.br-t { border: 2px solid var(--ok); }
.node.br-f { border: 2px solid var(--bad); }
.node.br-t:not(.editing) .cap { background: #dcefe2 !important; color: var(--ok); }
.node.br-f:not(.editing) .cap { background: #f6dcd7 !important; color: var(--bad); }
.node.br-t.has-todo, .node.br-f.has-todo { border-width: 2px; }
.node.br-t .cap::after { content: "TRUE"; margin-left: auto; font-size: 10px; letter-spacing: .06em; }
.node.br-f .cap::after { content: "FALSE"; margin-left: auto; font-size: 10px; letter-spacing: .06em; }

/* description blocks */
.node.t-desc { font-size: 14px; line-height: 1.5; }
.node.t-desc.bgc-note { background: #fff6cf; border-color: #e2d28a; }
.node.t-desc.bgc-plain { background: #fff; border-color: var(--line); }
.node.t-desc.bgc-sky { background: #e3edfb; border-color: #aac3e6; }
.node.t-desc.bgc-mint { background: #e2f2e7; border-color: #a8cdb4; }
.node.t-desc.bgc-rose { background: #fbe4e0; border-color: #e3b1a8; }
.node.t-desc.bgc-gray { background: #ebe9e3; border-color: #c9c5ba; }
.node.t-desc:not(.editing) .cap { background: rgba(0,0,0,.05) !important; }
.node.t-desc .txt { color: inherit; }
.swatches { display: flex; gap: 8px; flex-wrap: wrap; margin: 2px 0 6px; }
.sw { width: 30px; height: 30px; border: 1px solid var(--line2); border-radius: 50%; padding: 0; font-weight: 700; display: grid; place-items: center; background: #fff; }
.sw.on { outline: 2px solid var(--ink); outline-offset: 2px; }
@media (max-width: 860px) { .sw { width: 40px; height: 40px; } }

/* highlights: the colour the hotel gave a block so the vendor sees where to look */
.node.node.mk-yellow { background: #fff4a8; border-color: #d9b600; box-shadow: 0 0 0 4px rgba(240,205,0,.45); }
.node.node.mk-orange { background: #ffe0bd; border-color: #e07a12; box-shadow: 0 0 0 4px rgba(240,140,30,.45); }
.node.node.mk-red { background: #fbd3cf; border-color: #c9382c; box-shadow: 0 0 0 4px rgba(220,60,50,.4); }
.node.node.mk-green { background: #d5efdb; border-color: #3d9a57; box-shadow: 0 0 0 4px rgba(60,160,90,.4); }
.node.node.mk-blue { background: #d6e4fb; border-color: #3b74d4; box-shadow: 0 0 0 4px rgba(60,120,220,.4); }
.node.marked:not(.editing) .cap { background: rgba(0,0,0,.07) !important; }
.sw-none { color: var(--muted); font-size: 18px; }
.mkchip { color: var(--ink); border-color: rgba(0,0,0,.15); }
.markpop { min-width: 0; padding: 8px; }
.markpop .swatches { margin: 6px 4px 2px; }

/* both languages on a voice block */
.node .en { margin-top: 7px; padding-top: 6px; border-top: 1px dotted var(--line2); color: var(--ink2); font-size: 12px; }
.node .en .name { font-weight: 600; }
.node .lg, .sh-lg { display: inline-block; font-size: 10px; font-weight: 700; letter-spacing: .06em; color: var(--muted); border: 1px solid var(--line2); border-radius: 3px; padding: 0 4px; margin-right: 6px; background: #fff; }
.node .en > .lg { float: left; margin-top: 2px; }
.audio .play .lg { flex: none; margin-right: 2px; }
.sh-lang { margin: 8px 0 12px; }
.sh-lang .sh-lg { margin-bottom: 4px; }
.mg-list { max-height: 260px; overflow: auto; font-size: 12.5px; margin: 6px 0; }
.mg-row { display: grid; grid-template-columns: 1fr 18px 1fr; gap: 6px; padding: 3px 0; border-bottom: 1px dotted var(--line); }
.mg-row.v { font-weight: 650; }
.mg-row i { font-style: normal; color: var(--muted); text-align: center; }

/* swipe down to close the phone sheet: the whole header is a grab area */
@media (max-width: 860px) { .sh-head { touch-action: none; } .sh-head .sh-x { touch-action: manipulation; } }
#sheet { will-change: transform; }

/* voice recordings: one calm block, a card per language, no heavy black buttons */
.au-wrap { margin-top: 18px; }
.au-hint { font-size: 13px; color: var(--ink2); margin: 0 0 10px; line-height: 1.45; }
.au-card { border: 1px solid var(--line2); border-radius: 10px; padding: 10px 12px 12px; margin: 0 0 12px; background: #fff; }
.au-card.none { border-style: dashed; border-color: var(--bad); background: #fdf8f6; }
.au-card.stale { border-color: var(--warn); }
.au-hd { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.au-hd b { font-size: 14px; flex: 1; min-width: 0; }
.au-pill { flex: none; font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: 999px; border: 1px solid var(--line2); color: var(--ink2); background: var(--paper); }
.au-st { flex: none; font-size: 12px; font-weight: 600; color: var(--ok); }
.au-card.none .au-st { color: var(--bad); } .au-card.stale .au-st { color: var(--warn); }
.au-empty { font-size: 13px; color: var(--ink2); margin: 0 0 10px; line-height: 1.45; }
.au-pick { margin-top: 10px; }
.au-pick .sbtn { width: 100%; }
.sbtn.soft { background: var(--paper); border-color: var(--line2); color: var(--ink); font-weight: 600; }
.sbtn.accent { background: #fff; border: 1.5px solid var(--ink); color: var(--ink); font-weight: 700; }
.au-card .sh-grid2 .sbtn.small { margin-left: 0; }
@media (min-width: 861px) { .au-card .sbtn.soft, .au-card .sbtn.accent { font-size: 13px; } }
.au-file { font-size: 14px; font-weight: 600; overflow-wrap: anywhere; margin: 0 0 2px; }
.au-act { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 10px; }
.au-pick { margin-top: 8px; display: flex; flex-direction: column; gap: 4px; }
.au-rm { align-self: flex-end; border: 0; background: none; color: var(--bad); font-size: 13px; padding: 8px 4px; text-decoration: underline; }
