/* NB Mind Map – clean line style (front end + inline editor) */
.nbmm {
	position: relative;
	width: 100%;
	box-sizing: border-box;
	overflow: hidden;
	margin: 1.5em 0;
	border: 1px solid #e8eaf0;
	border-radius: 16px;
	background: #fff;
	color: #1f2937;
	font-family: inherit;
	line-height: 1.35;
	-webkit-user-select: none;
	user-select: none;
	isolation: isolate; /* own stacking context: the title can sit at z-index -1 (under the map) without going behind the page */
}
.nbmm *, .nbmm *::before, .nbmm *::after { box-sizing: border-box; }

.nbmm-viewport { position: absolute; inset: 0; overflow: hidden; cursor: grab; touch-action: none; }
.nbmm-viewport.is-grabbing { cursor: grabbing; }

.nbmm-stage { position: absolute; left: 0; top: 0; width: 0; height: 0; transform-origin: 0 0; will-change: transform; }
.nbmm-stage.is-anim { transition: transform .35s ease; }

.nbmm-lines { position: absolute; left: 0; top: 0; overflow: visible; pointer-events: none; }
.nbmm-lines path { fill: none; stroke-linecap: round; transition: opacity .3s ease; }
.nbmm-lines path.is-hidden { opacity: 0; }

/* Nodes: text sitting on a colored line */
.nbmm .nbmm-node {
	position: absolute;
	left: 0;
	top: 0;
	width: max-content;
	max-width: 300px;
	font-size: 14px;
	color: #1f2937;
	transition: transform .35s ease, opacity .3s ease, background .15s ease;
}
.nbmm .nbmm-main {
	position: relative;
	padding: 3px 8px 4px;
	border-bottom: 2.5px solid var(--c, #888);
	border-radius: 4px 4px 0 0;
	background: transparent;
	transition: background .15s ease;
}
.nbmm .nbmm-node.d0 { font-size: 17px; font-weight: 700; }
.nbmm .nbmm-node.d0 > .nbmm-main { padding: 6px 16px 7px; background: #f3f4f8; border-radius: 8px 8px 0 0; }
.nbmm .nbmm-node.d1 { font-size: 15px; font-weight: 600; }
.nbmm .nbmm-node.is-hidden {
	opacity: 0;
	pointer-events: none;
	visibility: hidden;
	transition: transform .35s ease, opacity .3s ease, visibility 0s linear .35s;
}
.nbmm .nbmm-node.has-kids, .nbmm .nbmm-node.has-link { cursor: pointer; }
.nbmm .nbmm-node:hover > .nbmm-main { background: var(--t, #f3f4f8); }
.nbmm .nbmm-node:focus { outline: none; }
.nbmm .nbmm-node:focus-visible { outline: 2px solid #818cf8; outline-offset: 2px; }

.nbmm .nbmm-label { display: block; color: inherit; overflow-wrap: anywhere; text-decoration: none; min-width: 12px; }
.nbmm a.nbmm-label, .nbmm a.nbmm-label:hover, .nbmm a.nbmm-label:focus, .nbmm a.nbmm-label:visited { text-decoration: none !important; border-bottom: 0 !important; box-shadow: none !important; color: inherit; }
.nbmm a.nbmm-label.is-ext::after { content: " \2197"; font-size: .85em; opacity: .7; }

/* Note: a short description / formula, shown below the line. It takes its own space (siblings are pushed down). */
.nbmm .nbmm-note {
	display: block;
	margin: 8px 0 3px;
	padding: 4px 8px;
	border: 1.5px dotted var(--nc, var(--c, #888));
	border-radius: 6px;
	background: var(--nt, rgba(255, 255, 255, .7));
	color: #374151;
	font-size: 12.5px;
	font-weight: 400;
	line-height: 1.4;
	white-space: pre-wrap;
	overflow-wrap: anywhere;
}
.nbmm .nbmm-node.d0 .nbmm-note { font-size: 13px; }

/* Expand / collapse bubble: arrow only. Map = › closed / ‹ open. Tree and Outline = ˅ closed / ˄ open. */
.nbmm .nbmm-tg {
	position: absolute;
	left: 100%;
	bottom: -9px;
	margin-left: 6px;
	width: 16px;
	height: 16px;
	padding: 0;
	border: 1.5px solid var(--c, #888);
	border-radius: 50%;
	background: var(--c, #888);
	cursor: pointer;
	-webkit-appearance: none;
	appearance: none;
	transition: transform .15s ease;
}
.nbmm .nbmm-tg::before {
	content: '';
	position: absolute;
	left: 50%;
	top: 50%;
	width: 5px;
	height: 5px;
	margin: 0 0 0 -1px;
	border-right: 2px solid #fff;
	border-bottom: 2px solid #fff;
	transform: translate(-50%, -50%) rotate(-45deg); /* › */
}
.nbmm .nbmm-node.is-open .nbmm-tg { background: #fff; }
.nbmm .nbmm-node.is-open .nbmm-tg::before { margin: 0 0 0 1px; border-color: var(--c, #888); transform: translate(-50%, -50%) rotate(135deg); } /* ‹ */
.nbmm.is-tree .nbmm-tg::before, .nbmm.is-outline .nbmm-tg::before { margin: -2px 0 0; transform: translate(-50%, -50%) rotate(45deg); } /* ˅ */
.nbmm.is-tree .nbmm-node.is-open .nbmm-tg::before, .nbmm.is-outline .nbmm-node.is-open .nbmm-tg::before { margin: 2px 0 0; transform: translate(-50%, -50%) rotate(-135deg); } /* ˄ */
.nbmm .nbmm-tg:hover { transform: scale(1.2); }

/* Edit mode */
.nbmm.is-editing { border-color: #a5b4fc; box-shadow: 0 0 0 3px rgba(129, 140, 248, .18); }
.nbmm .nbmm-node.is-selected > .nbmm-main { background: var(--t, #eef2ff); outline: 2px dashed var(--c, #818cf8); outline-offset: 3px; }
.nbmm .nbmm-label.is-editing { outline: none; cursor: text; -webkit-user-select: text; user-select: text; caret-color: #4f46e5; }

/* Header + buttons */
.nbmm-head {
	position: absolute;
	left: 0;
	right: 0;
	top: 0;
	/* no z-index here: the buttons and the title are layered one by one below, so the title can sit under the map */
	display: flex;
	align-items: center;
	justify-content: space-between;
	flex-wrap: wrap;
	gap: 10px;
	padding: 12px 14px;
	pointer-events: none;
}
.nbmm-title { font-size: 18px; font-weight: 600; color: #111827; }
.nbmm-actions { position: relative; z-index: 5; display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-left: auto; pointer-events: auto; } /* buttons stay on top of the map */
.nbmm-hint { font-size: 12px; color: #6b7280; margin-right: 4px; }
/* Buttons first, the map title on its own line below them */
.nbmm .nbmm-actions { order: -1; width: 100%; justify-content: flex-end; }
/* The map title is the lowest layer: when the map is moved it slides over the title, never under it */
.nbmm .nbmm-title { position: relative; z-index: -1; width: 100%; }
.nbmm .nbmm-title:empty { display: none; }

.nbmm .nbmm-btn, .nbmm .nbmm-zbtn, .nbmm .nbmm-bbtn {
	-webkit-appearance: none;
	appearance: none;
	margin: 0;
	cursor: pointer;
	font-family: inherit;
	letter-spacing: normal;
	text-transform: none;
}
.nbmm .nbmm-btn {
	padding: 7px 14px;
	border: 1px solid #dfe3ee;
	border-radius: 999px;
	background: #fff;
	color: #374151;
	font-size: 13px;
	font-weight: 600;
	line-height: 1.2;
	box-shadow: 0 1px 3px rgba(20, 30, 70, .08);
	transition: background .15s, border-color .15s, color .15s;
}
.nbmm .nbmm-btn:hover { background: #eef2ff; border-color: #c7d2fe; color: #4338ca; }
.nbmm .nbmm-btn-icon { padding: 7px 11px; }
.nbmm .nbmm-btn-primary { background: #4f46e5; border-color: #4f46e5; color: #fff; }
.nbmm .nbmm-btn-primary:hover { background: #4338ca; border-color: #4338ca; color: #fff; }
.nbmm .nbmm-btn:disabled { opacity: .6; cursor: default; }

.nbmm-zoom {
	position: absolute;
	right: 14px;
	bottom: 14px;
	z-index: 5;
	display: flex;
	flex-direction: column;
	overflow: hidden;
	border-radius: 999px;
	background: #fff;
	box-shadow: 0 2px 12px rgba(20, 30, 70, .18);
}
.nbmm .nbmm-zbtn { width: 40px; height: 40px; padding: 0; border: 0; background: transparent; color: #374151; font-size: 21px; line-height: 40px; text-align: center; }
.nbmm .nbmm-zbtn + .nbmm-zbtn { border-top: 1px solid #eef0f6; }
.nbmm .nbmm-zbtn:hover { background: #eef2ff; color: #4338ca; }

/* Phones: the zoom buttons sit in the top toolbar, next to the fullscreen button */
.nbmm .nbmm-actions .nbmm-zoom { position: static; flex-direction: row; border: 1px solid #dfe3ee; box-shadow: none; }
.nbmm .nbmm-actions .nbmm-zbtn { width: 34px; height: 30px; font-size: 18px; line-height: 30px; }
.nbmm .nbmm-actions .nbmm-zbtn + .nbmm-zbtn { border-top: 0; border-left: 1px solid #eef0f6; }
.nbmm .nbmm-actions .nbmm-zbtn.nbmm-zpct { width: 48px; font-size: 11px; }

/* Edit toolbar (bottom) */
.nbmm-bar {
	position: absolute;
	left: 50%;
	bottom: 14px;
	z-index: 6;
	display: none;
	align-items: center;
	flex-wrap: wrap;
	justify-content: center;
	gap: 4px;
	max-width: calc(100% - 80px);
	transform: translateX(-50%);
	padding: 6px;
	border-radius: 14px;
	background: #111827;
	box-shadow: 0 6px 24px rgba(17, 24, 39, .35);
}
.nbmm.is-editing .nbmm-bar { display: flex; }
.nbmm-bar-hint { padding: 0 8px; font-size: 13px; color: #cbd5e1; }
.nbmm .nbmm-bbtn {
	padding: 7px 11px;
	border: 0;
	border-radius: 9px;
	background: transparent;
	color: #f3f4f6;
	font-size: 13px;
	font-weight: 600;
	line-height: 1.2;
}
.nbmm .nbmm-bbtn:hover:not(:disabled) { background: #374151; }
.nbmm .nbmm-bbtn.is-danger:hover:not(:disabled) { background: #b91c1c; }
.nbmm .nbmm-bbtn:disabled { opacity: .35; cursor: default; }

/* Popover panel (link / color / outline) */
.nbmm-panel {
	position: absolute;
	left: 50%;
	bottom: 70px;
	z-index: 7;
	display: none;
	width: min(420px, calc(100% - 24px));
	transform: translateX(-50%);
	padding: 12px;
	border: 1px solid #e5e7eb;
	border-radius: 14px;
	background: #fff;
	box-shadow: 0 10px 34px rgba(17, 24, 39, .25);
	-webkit-user-select: text;
	user-select: text;
	max-height: 70%;
	overflow-y: auto;
}
.nbmm-panel.is-on { display: block; }
.nbmm-panel-title { margin-bottom: 8px; font-size: 13px; font-weight: 600; color: #374151; }
.nbmm-panel-row { display: flex; align-items: center; justify-content: flex-end; gap: 8px; margin-top: 10px; }
.nbmm-panel-row .nbmm-chk { margin-right: auto; font-size: 13px; color: #374151; }
.nbmm .nbmm-in { width: 100%; padding: 8px 10px; border: 1px solid #d1d5db; border-radius: 8px; font: inherit; font-size: 14px; color: #111827; background: #fff; }
.nbmm .nbmm-ta { resize: vertical; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; }
.nbmm-swatches { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.nbmm .nbmm-swatch { width: 28px; height: 28px; padding: 0; border: 2px solid #fff; border-radius: 50%; box-shadow: 0 0 0 1px #d1d5db; cursor: pointer; }
.nbmm .nbmm-swatch:hover { transform: scale(1.12); }

/* Toast */
.nbmm-toast {
	position: absolute;
	left: 50%;
	top: 58px;
	z-index: 9;
	padding: 8px 14px;
	border-radius: 999px;
	background: #065f46;
	color: #fff;
	font-size: 13px;
	font-weight: 600;
	opacity: 0;
	pointer-events: none;
	transform: translate(-50%, -6px);
	transition: opacity .25s, transform .25s;
}
.nbmm-toast.is-on { opacity: 1; transform: translate(-50%, 0); }
.nbmm-toast.is-err { background: #b91c1c; }

/* Fullscreen */
.nbmm:fullscreen { height: 100vh !important; max-height: none !important; border-radius: 0; margin: 0; background: #fff; }
.nbmm.nbmm-fs { position: fixed; inset: 0; z-index: 99999; height: 100vh !important; max-height: none !important; border-radius: 0; margin: 0; }

.nbmm.nbmm-noanim .nbmm-node,
.nbmm.nbmm-noanim .nbmm-stage,
.nbmm.nbmm-noanim .nbmm-lines path { transition: none !important; }

.nbmm-fallback { margin: 1em; padding-left: 1.2em; -webkit-user-select: text; user-select: text; }

@media (max-width: 640px) {
	.nbmm-head { padding: 8px; }
	.nbmm-title { font-size: 15px; }
	.nbmm-hint { display: none; }
	.nbmm .nbmm-btn { padding: 6px 10px; font-size: 12px; }
	.nbmm .nbmm-node { font-size: 13px; max-width: 220px; }
	.nbmm-bar { max-width: calc(100% - 70px); bottom: 10px; }
	.nbmm .nbmm-bbtn { padding: 6px 8px; font-size: 12px; }
}

@media (prefers-reduced-motion: reduce) {
	.nbmm .nbmm-node, .nbmm-stage.is-anim, .nbmm-lines path { transition: none !important; }
}

.nbmm .nbmm-btn.is-danger { color: #b91c1c; border-color: #fecaca; }
.nbmm .nbmm-btn.is-danger:hover { background: #b91c1c; color: #fff; }

.nbmm .nbmm-colorin { width: 30px; height: 28px; padding: 0; border: 1px solid #d1d5db; border-radius: 6px; background: #fff; cursor: pointer; }
.nbmm-swatches { align-items: center; }

/* Optional outer box around a point (uses the line color). All four corners stay rounded;
   lines attach to the middle of the side edges (see JS), never to a corner. */
.nbmm .nbmm-main.box-dotted { border: 2px dotted var(--c, #888); border-radius: 10px !important; }
.nbmm .nbmm-main.box-solid { border: 2px solid var(--c, #888); border-radius: 10px !important; }
.nbmm .nbmm-main.box-dotted > .nbmm-tg, .nbmm .nbmm-main.box-solid > .nbmm-tg { bottom: auto; top: 50%; margin-top: -8px; }
.nbmm .nbmm-pos { display: inline-flex; gap: 2px; padding: 2px; border: 1px solid #dfe3ee; border-radius: 999px; background: #fff; }
.nbmm .nbmm-pos .nbmm-btn { padding: 4px 10px; border: 0; font-size: 12px; }
.nbmm .nbmm-pos-lbl { align-self: center; padding: 0 4px 0 8px; font-size: 12px; color: #6b7280; }
.nbmm .nbmm-levels .nbmm-btn { min-width: 26px; padding: 4px 8px; }



/* Phones: a swipe on the map moves the map (scroll the page by swiping outside the box) */
.nbmm.is-flow:not(.nbmm-fs):not(:fullscreen) .nbmm-viewport { touch-action: none; cursor: grab; }

/* Phone tree (top to bottom): expand bubble sits under the node, centered */
.nbmm.is-tree .nbmm-main { position: static; }
.nbmm.is-tree .nbmm-node .nbmm-main .nbmm-tg { left: 50%; top: 100%; bottom: auto; margin: 6px 0 0 -8px; }

/* Editable map title (top left while editing) */
.nbmm .nbmm-title-in { font: inherit; color: inherit; width: min(320px, 100%); padding: 2px 8px; border: 1px dashed #94a3b8; border-radius: 6px; background: #fff; }
.nbmm .nbmm-title-in:focus { outline: 2px solid #6366f1; outline-offset: 1px; border-style: solid; }

/* The top bar ignores the mouse so the map can be dragged under it; the title must still be clickable/typable */
.nbmm .nbmm-title.is-editing { z-index: 5; } /* while editing, the title box must stay reachable; only the box itself takes clicks */
.nbmm .nbmm-title-in { pointer-events: auto; }

/* Note arrow: a small tab hanging from the bottom line (or box border) of the point, so the line itself looks like it has an
   open / close arrow. It fills the gap between the line and the note. (The children button is on the right.) */
.nbmm .nbmm-notebtn {
	position: absolute; left: 5px; top: 0; z-index: 6;
	display: block; width: 20px; height: 9px; padding: 0; margin: 0;
	border: 1.5px solid var(--c, #888); border-top: 0; border-radius: 0 0 10px 10px;
	background: #fff; cursor: pointer;
	transition: background .15s ease;
}
.nbmm .nbmm-notebtn::before {
	content: ''; position: absolute; left: 50%; top: 50%; width: 5px; height: 5px;
	border-right: 1.5px solid var(--c, #555); border-bottom: 1.5px solid var(--c, #555);
	transform: translate(-50%, -78%) rotate(45deg); transition: transform .2s ease;
}
.nbmm .nbmm-notebtn::after { content: ''; position: absolute; left: -6px; right: -6px; top: 0; bottom: -7px; } /* bigger click area, only downwards and sideways */
.nbmm .nbmm-node:not(.note-closed) .nbmm-notebtn::before { transform: translate(-50%, -22%) rotate(-135deg); }
.nbmm .nbmm-notebtn:hover { background: var(--t, #f3f4f8); }
.nbmm .nbmm-node.note-closed .nbmm-note { display: none; }

.nbmm .nbmm-zbtn.nbmm-zpct { height: 30px; font-size: 11px; font-weight: 600; line-height: 30px; letter-spacing: 0; }

/* Phones: slightly smaller toolbar so it fits in two lines */
@media (max-width: 640px) {
	.nbmm .nbmm-actions { gap: 5px; }
	.nbmm .nbmm-actions .nbmm-btn { padding: 5px 8px; font-size: 11px; }
	.nbmm .nbmm-pos .nbmm-btn { padding: 4px 7px; font-size: 11px; }
	.nbmm .nbmm-actions .nbmm-zbtn { width: 28px; height: 28px; font-size: 16px; line-height: 28px; }
	.nbmm .nbmm-actions .nbmm-zbtn.nbmm-zpct { width: 40px; font-size: 10px; }
}

/* Edit mode: a small tab at the top-right of every point, fused to its top edge (like the note arrow at the bottom-left):
   [ + | - ]  where + adds a sub-point and - deletes the point */
.nbmm .nbmm-pm {
	display: none; position: absolute; right: 5px; bottom: 100%; margin-bottom: -1px; z-index: 6;
	border: 1.5px solid var(--c, #888); border-bottom: 0; border-radius: 10px 10px 0 0;
	background: #fff; overflow: hidden;
}
/* The + / - tab shows only while the mouse is over the point (touch screens: on the selected point) */
.nbmm.is-editing .nbmm-node:hover > .nbmm-pm { display: flex; }
@media (hover: none) {
	.nbmm.is-editing .nbmm-node.is-selected > .nbmm-pm { display: flex; }
}
.nbmm.is-dragging .nbmm-pm { display: none !important; }
.nbmm .nbmm-pm button {
	position: relative; display: block; width: 20px; height: 15px; padding: 0; margin: 0;
	border: 0; background: transparent; cursor: pointer;
	-webkit-appearance: none; appearance: none; transition: background .15s ease;
}
.nbmm .nbmm-pm button + button { border-left: 1.5px solid var(--c, #888); }
.nbmm .nbmm-pm button::before, .nbmm .nbmm-plusbtn::after {
	content: ''; position: absolute; left: 50%; top: 50%; background: var(--c, #555); transform: translate(-50%, -50%);
}
.nbmm .nbmm-pm button::before { width: 8px; height: 1.5px; }
.nbmm .nbmm-plusbtn::after { width: 1.5px; height: 8px; }
.nbmm .nbmm-pm button:hover { background: var(--t, #eef2ff); }
.nbmm .nbmm-pm .nbmm-minusbtn:hover { background: #fee2e2; }
.nbmm .nbmm-pm .nbmm-minusbtn:hover::before { background: #dc2626; }

/* Bottom edit bar: smaller text and tighter buttons so it stays inside the box */
.nbmm .nbmm-bar { width: max-content; max-width: calc(100% - 20px); padding: 4px; gap: 2px; border-radius: 12px; }
.nbmm .nbmm-bbtn { padding: 5px 8px; font-size: 11.5px; line-height: 1.2; white-space: nowrap; border-radius: 8px; }
.nbmm .nbmm-bar-hint { font-size: 12px; }
@media (max-width: 640px) {
	.nbmm .nbmm-bar { bottom: 8px; padding: 3px; }
	.nbmm .nbmm-bbtn { padding: 5px 7px; font-size: 11px; }
}

/* Edit mode: long-press a point, then drag it onto another point */
.nbmm.is-editing .nbmm-node { -webkit-touch-callout: none; touch-action: none; }
.nbmm.is-dragging, .nbmm.is-dragging * { cursor: grabbing !important; }
.nbmm .nbmm-node.is-dragsrc { opacity: .35; }
.nbmm .nbmm-ghost {
	position: absolute; z-index: 60; pointer-events: none; max-width: 220px; padding: 5px 12px;
	background: #fff; border: 2px solid #4f46e5; border-radius: 10px; font-size: 14px; font-weight: 600; color: #1f2937;
	white-space: nowrap; overflow: hidden; text-overflow: ellipsis; box-shadow: 0 8px 22px rgba(17, 24, 39, .22); opacity: .95;
	transform: scale(1.08); transform-origin: left top; animation: nbmm-lift .18s ease-out;
}
@keyframes nbmm-lift { from { transform: scale(.9); opacity: .4; } to { transform: scale(1.08); opacity: .95; } }
.nbmm.is-dragging .nbmm-node > .nbmm-main { transition: transform .15s ease, background .15s ease; transform-origin: left center; }
.nbmm .nbmm-node.is-drop-child > .nbmm-main { background: #eef2ff; outline: 2px solid #4f46e5; outline-offset: 3px; border-radius: 8px; transform: scale(1.07); }
.nbmm .nbmm-dropplus {
	position: absolute; right: -13px; width: 22px; height: 22px; border-radius: 50%; z-index: 7; pointer-events: none;
	background: #4f46e5; box-shadow: 0 0 0 3px #fff, 0 4px 10px rgba(79, 70, 229, .45); animation: nbmm-pop .18s ease-out;
}
.nbmm .nbmm-dropplus::before, .nbmm .nbmm-dropplus::after { content: ''; position: absolute; left: 50%; top: 50%; background: #fff; border-radius: 1px; transform: translate(-50%, -50%); }
.nbmm .nbmm-dropplus::before { width: 10px; height: 2px; }
.nbmm .nbmm-dropplus::after { width: 2px; height: 10px; }
@keyframes nbmm-pop { from { transform: scale(.3); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.nbmm .nbmm-node.is-drop-before > .nbmm-main { box-shadow: 0 -4px 0 0 #4f46e5; }
.nbmm .nbmm-node.is-drop-after > .nbmm-main { box-shadow: 0 4px 0 0 #4f46e5; }

/* "Anyone can edit" box at the end of the bottom edit bar */

/* Movable panels: grab the grip bar or the title and drag */
.nbmm-panel-grip { position: sticky; top: -12px; z-index: 1; display: flex; align-items: center; justify-content: center; height: 18px; margin: -12px -12px 4px; border-radius: 14px 14px 0 0; background: #fff; cursor: grab; touch-action: none; }
.nbmm-panel-grip::before { content: ''; width: 38px; height: 4px; border-radius: 2px; background: #cbd5e1; }
.nbmm-panel-grip:hover::before { background: #94a3b8; }
.nbmm-panel-title { cursor: grab; touch-action: none; -webkit-user-select: none; user-select: none; }
.nbmm-panel.is-moving, .nbmm-panel.is-moving .nbmm-panel-grip, .nbmm-panel.is-moving .nbmm-panel-title { cursor: grabbing; }
.nbmm-panel.is-moving { box-shadow: 0 14px 40px rgba(17, 24, 39, .32); }

/* Phones: zoom box stays bottom right, vertical, like on desktop; fullscreen joins it */
.nbmm.is-flow.is-editing .nbmm-zoom { bottom: 96px; }
.nbmm.is-flow .nbmm-zoom { right: 10px; bottom: 12px; }
.nbmm.is-flow.is-editing .nbmm-zoom { bottom: 96px; }

/* Phones: slimmer zoom box (thin vertical strip) */
.nbmm.is-flow .nbmm-zoom .nbmm-zbtn { width: 28px; height: 28px; font-size: 15px; line-height: 28px; }
.nbmm.is-flow .nbmm-zoom .nbmm-zbtn.nbmm-zpct { width: 28px; height: 24px; font-size: 8px; line-height: 24px; letter-spacing: -.3px; }
.nbmm.is-flow .nbmm-zoom { right: 6px; border-radius: 14px; opacity: .92; }

/* Double-arrow "scroll the page down" button at the end of the zoom box */
.nbmm .nbmm-zbtn.nbmm-zdown { display: flex; align-items: center; justify-content: center; line-height: 1; }
.nbmm.is-flow .nbmm-zoom .nbmm-zbtn.nbmm-zdown svg { width: 15px; height: 15px; }
.nbmm.nbmm-fs .nbmm-zdown, .nbmm:fullscreen .nbmm-zdown { display: none; }

/* Panels: option cards (+ Map, Import outline) */
.nbmm-panel-sub { margin: -4px 0 10px; font-size: 12px; line-height: 1.4; color: #6b7280; }
.nbmm-panel-hint { margin: 8px 0 6px; font-size: 12px; line-height: 1.4; color: #374151; }
.nbmm-panel-fine { color: #6b7280; font-size: 11px; }
.nbmm-choices { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 10px; }
.nbmm .nbmm-choice { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; margin: 0; padding: 10px 11px; text-align: left; text-transform: none; letter-spacing: 0; font: inherit; color: #111827; background: #fff; border: 1.5px solid #e5e7eb; border-radius: 12px; box-shadow: none; cursor: pointer; transition: border-color .15s, background .15s, box-shadow .15s; }
.nbmm .nbmm-choice:hover:not(:disabled) { border-color: #c7d2fe; background: #f8faff; }
.nbmm .nbmm-choice.is-on { border-color: #4f46e5; background: #eef2ff; box-shadow: 0 0 0 3px rgba(79, 70, 229, .12); }
.nbmm .nbmm-choice:disabled { opacity: .55; cursor: not-allowed; }
.nbmm .nbmm-choice-ico { display: flex; align-items: center; justify-content: center; width: 28px; height: 28px; margin-bottom: 2px; border-radius: 8px; background: #eef2ff; color: #4f46e5; font-size: 15px; line-height: 1; }
.nbmm .nbmm-choice.is-on .nbmm-choice-ico { background: #4f46e5; color: #fff; }
.nbmm .nbmm-choice-t { font-size: 13px; font-weight: 600; line-height: 1.25; }
.nbmm .nbmm-choice-d { font-size: 11.5px; line-height: 1.35; color: #6b7280; }
.nbmm .nbmm-aibox { margin-bottom: 4px; padding: 10px; border-radius: 12px; background: #f8fafc; border: 1px solid #eef0f6; }
.nbmm-panel-row { flex-wrap: wrap; }
@media (max-width: 400px) { .nbmm-choices { grid-template-columns: 1fr; } }

/* Toolbar: eye-catching, self-explaining buttons for + Map / Outline / Word file / Web page */
.nbmm .nbmm-btn.nbmm-tb { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
.nbmm .nbmm-tb-ico { font-size: 13px; line-height: 1; }
.nbmm .nbmm-tb-name { font-weight: 700; }
.nbmm .nbmm-tb-sub { padding-left: 6px; border-left: 1px solid currentColor; font-size: .82em; font-weight: 500; opacity: .62; }
.nbmm .nbmm-tb-map  { background: #eef2ff; border-color: #c7d2fe; color: #4338ca; }
.nbmm .nbmm-tb-out  { background: #f1f5f9; border-color: #cbd5e1; color: #334155; }
.nbmm .nbmm-tb-map:hover  { background: #e0e7ff; border-color: #a5b4fc; color: #3730a3; }
.nbmm .nbmm-tb-out:hover  { background: #e2e8f0; border-color: #94a3b8; color: #1e293b; }
@media (max-width: 640px) { .nbmm .nbmm-tb-sub { display: none; } }

.nbmm .nbmm-tb-import { background: #eff6ff; border-color: #bfdbfe; color: #1d4ed8; }
.nbmm .nbmm-tb-import:hover { background: #dbeafe; border-color: #93c5fd; color: #1e40af; }

/* User menu (My maps) and share panel */
.nbmm-mm-list { max-height: 240px; overflow: auto; margin-top: 4px; }
.nbmm-mm-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 0; border-bottom: 1px solid #e5e7eb; }
.nbmm-mm-info { display: flex; flex-direction: column; min-width: 0; }
.nbmm-mm-t { font-size: 13px; font-weight: 600; color: #1f2937; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-decoration: none; }
a.nbmm-mm-t { display: block; color: #4f46e5; }
.nbmm-mm-s { font-size: 12px; color: #6b7280; }
.nbmm-mm-btns { display: flex; gap: 6px; flex: none; }
.nbmm-mm-share { margin-top: 10px; }
.nbmm-mm-line { display: flex; gap: 6px; align-items: center; margin-top: 4px; }
.nbmm-mm-line .nbmm-in { flex: 1; width: auto; min-width: 0; }

/* "My menu" dropdown (top left) */
.nbmm-um { position: relative; margin-right: auto; }
.nbmm .nbmm-um-btn { display: inline-flex; align-items: center; gap: 8px; padding: 4px 12px 4px 4px; border: 1px solid #dfe3ee; border-radius: 999px; background: #fff; color: #1f2937; font: inherit; font-size: 13px; font-weight: 600; line-height: 1.2; cursor: pointer; box-shadow: 0 1px 3px rgba(20, 30, 70, .08); transition: background .15s, border-color .15s, box-shadow .15s; }
.nbmm .nbmm-um-btn:hover, .nbmm .nbmm-um-btn[aria-expanded="true"] { background: #f5f7ff; border-color: #c7d2fe; box-shadow: 0 4px 14px rgba(79, 70, 229, .15); }
.nbmm-um-av { display: grid; place-items: center; flex: none; width: 28px; height: 28px; border-radius: 50%; background: linear-gradient(135deg, #6366f1, #8b5cf6); color: #fff; font-size: 13px; font-weight: 700; }
.nbmm-um-av-lg { width: 40px; height: 40px; font-size: 17px; }
.nbmm-um-car { font-size: 11px; color: #6b7280; transition: transform .15s; }
.nbmm-um-btn[aria-expanded="true"] .nbmm-um-car { transform: rotate(180deg); }
.nbmm-um-dd { display: none; position: absolute; left: 0; top: calc(100% + 8px); z-index: 30; width: min(330px, 82vw); max-height: min(72vh, 520px); overflow: auto; padding: 8px; border: 1px solid #e8eaf0; border-radius: 16px; background: #fff; box-shadow: 0 22px 48px rgba(15, 23, 42, .2), 0 2px 6px rgba(15, 23, 42, .06); text-align: left; }
.nbmm-um-dd.is-open { display: block; animation: nbmm-um-in .14s ease-out; }
@keyframes nbmm-um-in { from { opacity: 0; transform: translateY(-6px) scale(.98); } to { opacity: 1; transform: none; } }
.nbmm-um-head { display: flex; align-items: center; gap: 12px; padding: 8px 8px 12px; border-bottom: 1px solid #eef0f6; }
.nbmm-um-who { display: flex; flex-direction: column; min-width: 0; }
.nbmm-um-hi { font-size: 11px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: #9ca3af; }
.nbmm-um-em { font-size: 13px; font-weight: 600; color: #111827; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nbmm .nbmm-um-new { display: flex; align-items: center; gap: 10px; width: 100%; margin: 10px 0 4px; padding: 10px 12px; border: 0; border-radius: 12px; background: linear-gradient(135deg, #4f46e5, #7c3aed); color: #fff; font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; box-shadow: 0 6px 16px rgba(79, 70, 229, .3); transition: transform .12s, box-shadow .12s; }
.nbmm .nbmm-um-new:hover { transform: translateY(-1px); box-shadow: 0 10px 22px rgba(79, 70, 229, .36); }
.nbmm-um-plus { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 7px; background: rgba(255, 255, 255, .22); font-size: 15px; line-height: 1; }
.nbmm-um-sec { margin: 12px 8px 4px; font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: #9ca3af; }
.nbmm-um-list { display: flex; flex-direction: column; gap: 2px; }
.nbmm-um-row { display: flex; align-items: center; gap: 4px; padding: 4px; border-radius: 12px; transition: background .12s; }
.nbmm-um-row:hover { background: #f5f7ff; }
.nbmm-um-row.is-cur { background: #eef2ff; }
.nbmm-um-main { display: flex; align-items: center; flex: 1; gap: 10px; min-width: 0; padding: 4px; border-radius: 10px; cursor: pointer; outline: none; }
.nbmm-um-main:focus-visible { box-shadow: 0 0 0 2px #6366f1; }
.nbmm-um-mi { display: grid; place-items: center; flex: none; width: 32px; height: 32px; border-radius: 10px; background: #e0e7ff; color: #4338ca; font-size: 14px; font-weight: 700; }
.nbmm-um-tx { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.nbmm-um-t { font-size: 13px; font-weight: 600; color: #111827; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nbmm-um-s { font-size: 11.5px; color: #6b7280; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nbmm-um-tag { flex: none; padding: 2px 7px; border-radius: 999px; background: #4f46e5; color: #fff; font-size: 10.5px; font-weight: 600; }
.nbmm-um-tag-share { background: #d1fae5; color: #047857; }
.nbmm-um-ac { display: flex; flex: none; gap: 2px; }
.nbmm .nbmm-um-ib { display: grid; place-items: center; width: 30px; height: 30px; padding: 0; border: 0; border-radius: 9px; background: transparent; color: #4b5563; font-size: 14px; line-height: 1; cursor: pointer; transition: background .12s, color .12s; }
.nbmm .nbmm-um-ib:hover { background: #e0e7ff; color: #4338ca; }
.nbmm .nbmm-um-ib.is-danger:hover { background: #fee2e2; color: #b91c1c; }
.nbmm-um-empty { padding: 10px 8px; font-size: 12.5px; color: #6b7280; }
.nbmm-um-err { padding: 0 8px; font-size: 12.5px; color: #b91c1c; }
.nbmm-um-err:not(:empty) { padding-top: 6px; }
.nbmm .nbmm-um-out { display: block; width: 100%; margin-top: 8px; padding: 10px 12px; border: 0; border-top: 1px solid #eef0f6; border-radius: 0 0 10px 10px; background: transparent; color: #6b7280; font: inherit; font-size: 13px; font-weight: 600; text-align: left; cursor: pointer; }
.nbmm .nbmm-um-out:hover { background: #f9fafb; color: #b91c1c; }
@media (max-width: 480px) { .nbmm-um-lbl { display: none; } .nbmm .nbmm-um-btn { padding-right: 8px; } }

/* New map options inside the dropdown, and the "save first?" step */
.nbmm .nbmm-um-new .nbmm-um-nl { flex: 1; text-align: left; }
.nbmm-um-nc { font-size: 11px; opacity: .85; transition: transform .15s; }
.nbmm-um-opts { display: flex; flex-direction: column; gap: 2px; margin: 4px 0 2px; padding: 6px; border-radius: 12px; background: #f8f9ff; border: 1px solid #eceffd; }
.nbmm .nbmm-um-opt { display: flex; align-items: flex-start; gap: 10px; width: 100%; padding: 8px; border: 0; border-radius: 10px; background: transparent; color: inherit; font: inherit; text-align: left; cursor: pointer; transition: background .12s; }
.nbmm .nbmm-um-opt:hover:not(:disabled) { background: #fff; box-shadow: 0 2px 8px rgba(79, 70, 229, .12); }
.nbmm .nbmm-um-opt:disabled { opacity: .55; cursor: default; }
.nbmm-um-oi { display: grid; place-items: center; flex: none; width: 28px; height: 28px; border-radius: 8px; background: #e0e7ff; font-size: 14px; }
.nbmm-um-otx { display: flex; flex-direction: column; min-width: 0; }
.nbmm-um-ot { font-size: 13px; font-weight: 600; color: #111827; }
.nbmm-um-od { font-size: 11.5px; line-height: 1.3; color: #6b7280; }
.nbmm-um-leave { padding: 12px 10px 8px; }
.nbmm-um-lt { font-size: 14px; font-weight: 700; color: #111827; }
.nbmm-um-ls { margin: 4px 0 12px; font-size: 12.5px; color: #6b7280; }
.nbmm-um-lrow { display: flex; flex-direction: column; gap: 6px; }
.nbmm .nbmm-um-lb { padding: 9px 12px; border: 1px solid #dfe3ee; border-radius: 10px; background: #fff; color: #374151; font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; }
.nbmm .nbmm-um-lb:hover { background: #f5f7ff; border-color: #c7d2fe; }
.nbmm .nbmm-um-lb.is-primary { border-color: transparent; background: linear-gradient(135deg, #4f46e5, #7c3aed); color: #fff; }
.nbmm .nbmm-um-lb.is-danger { color: #b91c1c; }
.nbmm .nbmm-um-lb.is-danger:hover { background: #fef2f2; border-color: #fecaca; }
.nbmm-um-row.is-busy{opacity:.45;pointer-events:none}

/* personal canvas with no map yet */
.nbmm-empty-hint { display: none; position: absolute; inset: 0; z-index: 1; flex-direction: column; align-items: center; justify-content: center; gap: 10px; padding: 24px; text-align: center; pointer-events: none; }
.nbmm-empty-hint > * { pointer-events: auto; }
.nbmm.nbmm-is-empty:not(.is-editing) .nbmm-empty-hint { display: flex; }
.nbmm-empty-t { font-size: 20px; font-weight: 700; color: #111827; }
.nbmm-empty-s { max-width: 420px; font-size: 14px; line-height: 1.5; color: #6b7280; }
.nbmm.nbmm-is-empty .nbmm-stage, .nbmm.nbmm-is-empty .nbmm-zoom, .nbmm.nbmm-is-empty .nbmm-title { display: none !important; }

/* wider My menu; long titles wrap (up to 2 lines) instead of being cut */
.nbmm-um-dd { width: min(440px, 92vw); }
.nbmm-um-t { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; line-height: 1.3; word-break: break-word; }

/* Menu on top: the toolbar and its dropdown sit above the title (also while the title is being edited), the zoom buttons, the bottom bar and the panels */
.nbmm .nbmm-actions { z-index: 40; }
.nbmm .nbmm-um { z-index: 41; }
.nbmm .nbmm-um-dd { z-index: 100; }

/* Menu dropdown: scrolls inside itself and never passes the scroll on to the page behind it */
.nbmm .nbmm-um-dd { overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }

/* Map list pager: ‹ 1–5 of 12 › */
.nbmm-um-pager { display: flex; align-items: center; justify-content: center; gap: 12px; padding: 8px 0 2px; }
.nbmm-um-pinfo { font-size: 12px; color: #6b7280; min-width: 80px; text-align: center; }
.nbmm-um-pager .nbmm-um-ib { width: 32px; height: 32px; font-size: 18px; border: 1px solid #e8eaf0; border-radius: 50%; }
.nbmm-um-pager .nbmm-um-ib:disabled { opacity: .35; cursor: default; }

/* Menu footer: Sign out and Close side by side */
.nbmm .nbmm-um-foot { display: flex; gap: 8px; }
.nbmm .nbmm-um-foot .nbmm-um-out { flex: 1; width: auto; margin-top: 8px; }
.nbmm .nbmm-um-foot .nbmm-um-out + .nbmm-um-out { text-align: center; border-left: 1px solid #eef0f6; }
.nbmm .nbmm-um-foot .nbmm-um-out + .nbmm-um-out:hover { color: #1f2937; }

/* "Scroll map" tick box beside Fullscreen; unticked = touch scrolls the page (map still pans sideways) */
.nbmm .nbmm-scrollopt { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; user-select: none; }
.nbmm .nbmm-scrollopt input { margin: 0; cursor: pointer; }
.nbmm.is-pagescroll .nbmm-viewport { touch-action: pan-y; }

/* Points and their lines appear together, at once: no fade or slide that leaves the text behind the lines */
.nbmm .nbmm-node { transition: background .15s ease; }
.nbmm .nbmm-node.is-hidden { transition: none; }
.nbmm .nbmm-lines path { transition: none; }

/* A point with an icon: a card with the icon above the text */
.nbmm .nbmm-main.has-icon { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; box-sizing: border-box; width: 128px; min-height: 82px; padding: 10px 8px !important; border: 1px solid #e5e7eb !important; border-top: 3px solid var(--c, #888) !important; border-radius: 12px !important; background: #fff; text-align: center; }
.nbmm .nbmm-main.has-icon .nbmm-ico { display: block; flex: none; width: 22px; height: 22px; color: var(--c, #888); }
.nbmm .nbmm-main.has-icon .nbmm-label { font-size: 13px; font-weight: 600; line-height: 1.25; }
.nbmm .nbmm-main.has-icon > .nbmm-tg { bottom: auto; top: 50%; margin-top: -8px; }
/* Uploaded image: any picture is scaled and cropped to fill the box, with the text below the box */
.nbmm .nbmm-main.has-icon.has-img { gap: 6px; justify-content: flex-start; width: var(--nbmm-imgw, 128px); max-width: 100%; min-height: 0; padding: 0 !important; border: 0 !important; border-radius: 0 !important; background: transparent !important; }
.nbmm .nbmm-main.has-icon.has-img .nbmm-ico.is-img { position: relative; box-sizing: border-box; width: 100%; height: auto; aspect-ratio: 128 / 84; overflow: hidden; border: 2px solid var(--c, #888); border-radius: 12px; background: #fff; }
.nbmm .nbmm-main.has-icon.has-img .nbmm-label { display: block; width: 100%; overflow-wrap: anywhere; }
.nbmm:not(.is-tree) .nbmm-main.has-icon.has-img > .nbmm-tg { top: var(--nbmm-imgmid, 42px); }
.nbmm .nbmm-img-size { margin-top: 10px; }
.nbmm .nbmm-img-size-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 6px; font-size: 13px; color: #374151; }
.nbmm .nbmm-img-size-val { font-size: 12px; color: #6b7280; }
.nbmm .nbmm-img-size input[type="range"] { display: block; box-sizing: border-box; width: 100%; height: 22px; margin: 0 0 8px; padding: 0; border: 0; background: transparent; -webkit-appearance: auto; appearance: auto; accent-color: #400b75; cursor: pointer; }
.nbmm .nbmm-img-size-btns { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.nbmm .nbmm-img-size-btns .nbmm-btn { min-width: 0; margin: 0; }
.nbmm .nbmm-img-size-btns .nbmm-btn.is-on { border-color: #400b75; background: #f6f2ff; color: #400b75; }
.nbmm .nbmm-main.has-icon .nbmm-ico img { display: block; width: 100%; max-width: none; height: 100%; object-fit: cover; object-position: center; border-radius: 0; margin: 0; }
.nbmm .nbmm-main.has-icon.has-img .nbmm-ico img { position: absolute; left: 0; top: 0; }

/* A point's own children layout (only maps that use it get .is-mixed) */
.nbmm.is-mixed .nbmm-node.lay-tree > .nbmm-main { position: static; }
.nbmm.is-mixed .nbmm-node.lay-tree > .nbmm-main > .nbmm-tg { left: 50%; top: 100%; bottom: auto; margin: 6px 0 0 -8px; }
.nbmm.is-mixed .nbmm-node.lay-tree > .nbmm-main > .nbmm-tg::before, .nbmm.is-mixed .nbmm-node.lay-outline > .nbmm-main > .nbmm-tg::before { margin: -2px 0 0; transform: translate(-50%, -50%) rotate(45deg); }
.nbmm.is-mixed .nbmm-node.lay-tree.is-open > .nbmm-main > .nbmm-tg::before, .nbmm.is-mixed .nbmm-node.lay-outline.is-open > .nbmm-main > .nbmm-tg::before { margin: 2px 0 0; transform: translate(-50%, -50%) rotate(-135deg); }
.nbmm.is-mixed .nbmm-node.on-line > .nbmm-main.has-icon.has-img { gap: 22px; } /* Outline right: the line runs between the image and the text. Same as RLINE in nbmm.js */
.nbmm .nbmm-layout-btns { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.nbmm .nbmm-layout-btns .nbmm-btn { min-width: 0; margin: 0; }
.nbmm .nbmm-layout-btns .nbmm-btn:first-child { grid-column: 1 / -1; }
.nbmm .nbmm-layout-btns .nbmm-btn.is-on { border-color: #400b75; background: #f6f2ff; color: #400b75; }
.nbmm .nbmm-layout-btns .nbmm-btn:disabled { opacity: .5; cursor: not-allowed; }
.nbmm .nbmm-layout-note { margin: 8px 0 0; font-size: 12px; line-height: 1.45; color: #6b7280; }
