/* Mind Map Maker (mindmap.js). Loaded after tool.css.
   The map is drawn on white paper in both themes, so what you see is what you download. */

/* ---------- the bar ---------- */
.mm-bar { gap: 8px 14px; padding: 8px 14px; }
.mm-bar-g { display: flex; align-items: center; gap: 4px; }
.mm-bar .tk-btn svg { width: 16px; height: 16px; }
.mm-ib { width: 30px; padding: 0; }
.mm-zoom { min-width: 60px; padding: 0 8px; font-variant-numeric: tabular-nums; }
.mm-sel { height: 28px; font-size: 12.5px; }
.mm-bar-end { margin-inline-start: auto; }
.mm-open { position: relative; overflow: hidden; }
.mm-open input { position: absolute; inset: 0; opacity: 0; cursor: pointer; font-size: 0; }
.mm-open:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- the map and the panel ---------- */
.mm-main { display: flex; flex-direction: column; gap: 10px; overflow: hidden; padding: 12px; }
.mm-work { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 12px; }
.mm-board {
  position: relative;
  min-height: 0;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  /* light squares, like graph paper; mindmap.js moves and zooms them with the map (--g, --gx, --gy). Not in downloads. */
  --mm-sq: rgba(15, 23, 42, 0.05);
  --mm-sq5: rgba(15, 23, 42, 0.085);
  background-color: #ffffff;
  background-image:
    linear-gradient(to right, var(--mm-sq5) 1px, transparent 1px),
    linear-gradient(to bottom, var(--mm-sq5) 1px, transparent 1px),
    linear-gradient(to right, var(--mm-sq) 1px, transparent 1px),
    linear-gradient(to bottom, var(--mm-sq) 1px, transparent 1px);
  background-size: calc(var(--g, 24px) * 5) calc(var(--g, 24px) * 5), calc(var(--g, 24px) * 5) calc(var(--g, 24px) * 5), var(--g, 24px) var(--g, 24px), var(--g, 24px) var(--g, 24px);
  background-position: var(--gx, 0) var(--gy, 0);
  touch-action: none;
  outline: none;
  user-select: none;
  -webkit-user-select: none;
  cursor: grab;
}
.mm-board:focus-visible { box-shadow: 0 0 0 3px var(--accent); }
.mm-board.is-panning, .mm-board.is-panning * { cursor: grabbing !important; }
.mm-board > svg { position: absolute; inset: 0; width: 100%; height: 100%; display: block; overflow: visible; }
.mm-node { cursor: pointer; }
.mm-selbox { fill: none; stroke: #0b7ea3; pointer-events: none; }
.mm-badge, .mm-tog, .mm-add { cursor: pointer; }
.mm-tog circle, .mm-add circle { fill: #ffffff; stroke: #0b7ea3; }
.mm-tog path, .mm-add path { stroke: #0b7ea3; stroke-linecap: round; fill: none; }
.mm-tog:hover circle, .mm-add:hover circle { fill: #0b7ea3; }
.mm-tog:hover path, .mm-add:hover path { stroke: #ffffff; }
.mm-ghost { pointer-events: none; }
.mm-drop { fill: rgba(11, 126, 163, 0.08); stroke: #0b7ea3; pointer-events: none; }
.mm-dropline { stroke: #0b7ea3; stroke-linecap: round; fill: none; pointer-events: none; }
.mm-editor {
  position: absolute;
  z-index: 3;
  margin: 0;
  padding: 0 4px;
  border: 0;
  border-radius: 6px;
  outline: 1.5px solid rgba(11, 126, 163, 0.75);
  background: rgba(255, 255, 255, 0.92);
  font-family: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, "Noto Sans Hebrew", "Noto Sans Arabic", sans-serif;
  text-align: center;
  resize: none;
  overflow: hidden;
  user-select: text;
  -webkit-user-select: text;
}
.mm-editor.is-root { background: rgba(31, 41, 55, 0.92); outline-color: #7dd3fc; }
.mm-empty { position: absolute; inset-inline: 12px; bottom: 12px; display: grid; justify-items: center; gap: 8px; padding: 12px 14px; border-radius: 10px; background: #f1f5f9; color: #334155; text-align: center; font-size: 13.5px; line-height: 1.45; cursor: default; }
.mm-empty p { margin: 0; max-width: 60ch; }
.mm-empty-b { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }

.mm-side { display: flex; flex-direction: column; min-height: 0; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); }
.mm-tabs { display: flex; gap: 2px; padding: 6px; border-bottom: 1px solid var(--line); }
.mm-tabs [role="tab"] { flex: 1; height: 32px; padding: 0 8px; border: 0; border-radius: 7px; background: transparent; color: var(--text-2); font-size: 13px; font-weight: 600; cursor: pointer; }
.mm-tabs [role="tab"]:hover { color: var(--text); background: var(--hover); }
.mm-tabs [role="tab"][aria-selected="true"] { background: var(--raised-2); color: var(--text); }
:root[data-theme="light"] .mm-tabs [role="tab"][aria-selected="true"] { background: var(--raised); box-shadow: inset 0 -2px 0 var(--accent); }
.mm-panel { flex: 1; min-height: 0; overflow: auto; display: grid; gap: 12px; align-content: start; padding: 14px; }
.mm-panel p { margin: 0; }
.mm-panel .tk-note { color: var(--text-2); }
.mm-h { margin: 0; font-size: 14px; font-weight: 650; }
.mm-h3 { margin: 0; font-size: 12.5px; font-weight: 650; color: var(--text-2); }
.mm-field { display: grid; gap: 5px; min-width: 0; }
.mm-field > label, .mm-lab, .mm-swatches legend, .mm-fmt legend { color: var(--text-2); font-size: 12.5px; }
.mm-in, .mm-text { width: 100%; padding: 0 10px; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--panel-2); color: var(--text); font: inherit; }
.mm-in { height: 34px; }
.mm-text { min-height: 64px; padding: 7px 10px; resize: vertical; line-height: 1.4; }
.mm-area { min-height: 260px; font-size: 13px; white-space: pre; overflow-wrap: normal; overflow-x: auto; tab-size: 2; }
.mm-in:focus, .mm-text:focus { outline: 0; border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.mm-color { width: 100%; height: 34px; padding: 2px 3px; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--panel-2); cursor: pointer; }
.mm-color::-webkit-color-swatch-wrapper { padding: 0; }
.mm-color::-webkit-color-swatch { border: 0; border-radius: 5px; }
.mm-color::-moz-color-swatch { border: 0; border-radius: 5px; }
.mm-panel .tk-select { width: 100%; max-width: none; }
.mm-two { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 10px; align-items: end; }
.mm-bold { min-height: 34px; }
.mm-swatches, .mm-fmt { display: grid; gap: 6px; margin: 0; padding: 0; border: 0; min-width: 0; }
.mm-swatches legend, .mm-fmt legend { padding: 0; margin-bottom: 6px; }
.mm-sw-row { display: flex; flex-wrap: wrap; gap: 6px; }
.mm-sw { position: relative; display: block; width: 28px; height: 28px; cursor: pointer; }
.mm-sw input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.mm-sw span:first-of-type { display: block; width: 100%; height: 100%; border-radius: 50%; background: var(--c); box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.35); }
.mm-sw-auto span:first-of-type { background: conic-gradient(#e8590c 0 25%, #1c7ed6 0 50%, #2f9e44 0 75%, #ae3ec9 0); }
.mm-sw input:checked + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.mm-sw input:focus-visible + span { outline: 3px solid var(--accent); outline-offset: 2px; }
.mm-grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.mm-grid2 .tk-btn { height: auto; min-height: 34px; padding: 6px 8px; white-space: normal; line-height: 1.25; font-size: 12.5px; }
.mm-row { display: flex; flex-wrap: wrap; gap: 6px; }
.mm-group { display: grid; gap: 10px; padding: 10px 12px 12px; border: 1px solid var(--line); border-radius: 10px; }
.mm-how { display: grid; gap: 6px; margin: 0; padding-inline-start: 18px; color: var(--text-2); font-size: 12.5px; line-height: 1.45; }
.mm-keys { display: grid; grid-template-columns: auto 1fr; gap: 6px 10px; margin: 0; font-size: 12.5px; line-height: 1.4; }
.mm-keys dt { font-weight: 600; white-space: nowrap; }
.mm-keys dd { margin: 0; color: var(--text-2); }
.mm-radio { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border: 1px solid var(--line); border-radius: 9px; background: var(--panel-2); font-size: 13px; cursor: pointer; }
.mm-radio:has(input:checked) { border-color: var(--accent); background: var(--info-bg); }
.mm-radio input { width: 16px; height: 16px; margin: 0; flex: none; accent-color: var(--accent); }
.mm-go { width: 100%; }
.mm-private { display: flex; align-items: center; gap: 8px; color: var(--text-2); font-size: 12px; }
.mm-private svg { width: 16px; height: 16px; color: var(--pass); }
.mm-err { color: var(--msg-error); font-size: 12.5px; }
.mm-err:empty { display: none; }
.mm-outline { display: grid; gap: 10px; }
.mm-outline[hidden] { display: none; }

/* ---------- the outline tree ---------- */
.mm-tree, .mm-tree ul { margin: 0; padding: 0; list-style: none; }
.mm-tree ul { padding-inline-start: 16px; border-inline-start: 1px solid var(--line); margin-inline-start: 7px; }
.mm-tree [role="treeitem"] { outline: none; }
.mm-ti { display: flex; align-items: baseline; gap: 4px; padding: 4px 6px; border-radius: 6px; font-size: 13px; line-height: 1.35; cursor: pointer; }
.mm-ti:hover { background: var(--hover); }
.mm-ti.is-sel { background: var(--info-bg); color: var(--text); }
.mm-tree [role="treeitem"]:focus-visible > .mm-ti { outline: 2px solid var(--accent); outline-offset: -1px; }
.mm-ti-tw { flex: none; width: 14px; color: var(--text-2); text-align: center; }
[dir="rtl"] .mm-ti-tw { transform: scaleX(-1); }
.mm-ti-t { min-width: 0; overflow-wrap: anywhere; }
.mm-ti-n { flex: none; margin-inline-start: auto; padding: 0 6px; border-radius: 999px; background: var(--raised); font-size: 11px; font-weight: 600; }

/* ---------- smaller windows ---------- */
@media (max-width: 1000px) {
  .mm-work { grid-template-columns: minmax(0, 1fr) 280px; gap: 10px; }
}
@media (max-width: 860px) {
  .mm-main { display: block; overflow: auto; }
  .mm-work { display: grid; grid-template-columns: minmax(0, 1fr); }
  .mm-board { height: max(360px, 62vh); }
  .mm-panel { overflow: visible; }
  .mm-bar-end { margin-inline-start: 0; }
}
@media (max-width: 520px) {
  .mm-bar { padding: 8px 10px; }
  .mm-bar .tk-btn span:not(.tk-sr):not(#zoomLabel) { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .mm-bar .tk-btn:not(.mm-zoom) { width: 32px; padding: 0; }
  .mm-main { padding: 10px; }
}
@media (forced-colors: active) {
  .mm-board { background: Canvas; background-image: none; }
  .mm-selbox { stroke: Highlight; }
  .mm-sw input:checked + span { outline-color: Highlight; }
}
