/* Mind Map styles: the outline (left), the map (centre, on its theme's background), the AI assistant (right), Properties
   (a window), Present. */
#main { display: flex; flex-direction: row; flex: 1; min-width: 0; min-height: 0; background: var(--panel); }

/* left: the outline (mind/outline.js) */
#mm-left { min-height: 0; }
.mm-pane { display: flex; flex-direction: column; min-height: 0; }
.mm-pane.grow { flex: 1; }
.mmo { display: flex; flex-direction: column; min-height: 0; flex: 1; }
.mmo-head { flex: none; padding: 8px 8px 6px; border-bottom: 1px solid var(--line-soft); }
.mmo-filter { width: 100%; }
.mmo-list { flex: 1; min-height: 0; overflow: auto; padding: 4px 0 16px; }
.mmo-row { display: flex; align-items: center; gap: 5px; height: 28px; padding-right: 8px; cursor: default; outline: none; color: var(--text); font-size: var(--fs-m); }
.mmo-row:hover { background: var(--hover-soft); }
.mmo-row.on { background: var(--prog-soft); color: var(--prog-strong); }
.mmo-row:focus-visible { box-shadow: inset 0 0 0 2px var(--prog); }
.mmo-twist { flex: none; width: 18px; height: 18px; display: inline-flex; align-items: center; justify-content: center; border: 0; border-radius: var(--radius-xs); background: none; padding: 0; color: var(--muted); cursor: pointer; }
.mmo-twist:hover { background: var(--hover); }
.mmo-twist .material-symbols-outlined { font-size: var(--ic); }
.mmo-twist.none { visibility: hidden; }
.mmo-dot { flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--faint); }
.mmo-dot.top { width: 10px; height: 10px; }
.mmo-text { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mmo-text.empty { color: var(--faint); }
.mmo-edit { flex: 1; min-width: 0; height: 24px; padding: 0 6px; border: 1px solid var(--prog); border-radius: var(--radius-xs); background: var(--surface); color: var(--text); font: inherit; outline: none; }
.mmo-meta, .mmo-task { flex: none; display: inline-flex; color: var(--muted); }
.mmo-meta .material-symbols-outlined, .mmo-task .material-symbols-outlined { font-size: var(--ic-s); }
.mmo-task.done { color: var(--ok); }
.mmo-marker { flex: none; }
.mmo-count { flex: none; padding: 0 6px; border-radius: var(--radius-pill); background: var(--sunk); color: var(--muted); font-size: var(--fs-xs); }
.mmo-sep { padding: 12px 12px 4px; color: var(--muted); font-size: var(--fs-xs); font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; }
.mmo-row.dragging { opacity: 0.45; }
.mmo-row.drop-before { box-shadow: inset 0 2px 0 var(--sel); }
.mmo-row.drop-after { box-shadow: inset 0 -2px 0 var(--sel); }
.mmo-row.drop-into { background: var(--sel-soft); }

/* centre: the map */
#mm-center { flex: 1; min-width: 0; display: flex; flex-direction: column; }
#mm-stage { position: relative; flex: 1; min-height: 160px; overflow: hidden; background: var(--surface); outline: none; user-select: none; -webkit-user-select: none; touch-action: none; }
#mm-stage:focus-visible { box-shadow: inset 0 0 0 2px var(--prog); }
#mm-stage.panning, #mm-stage.panning * { cursor: grabbing !important; }
#mm-stage[data-tool="relation"] { cursor: crosshair; }
#mm-stage[data-tool="hand"] { cursor: grab; }
.mm-svg { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.mm-svg text { user-select: none; }
.mm-topic.mm-editing .mm-text { visibility: hidden; }
.mm-badge, .mm-plus, .mm-fold, .mm-task, .mm-ic-link, .mm-ic-note, .mm-rel, .mm-bound-label, .mm-sumbrace { cursor: pointer; }
.mm-edit { position: absolute; z-index: 5; margin: 0; padding: 0 2px; border: 0; background: transparent; resize: none; overflow: hidden; outline: none; white-space: pre-wrap; overflow-wrap: anywhere; box-sizing: content-box; }

/* right: the AI assistant (mind/assist.js); Properties is a window from its button on the top bar */
#mm-side { min-height: 0; }
#mm-assist-pane { display: flex; flex-direction: column; min-height: 0; }
#mm-props { flex: 1; min-height: 0; overflow: auto; padding: 0 0 12px; }
.mm-markers { display: flex; flex-direction: column; gap: 3px; }
.mm-mrow { display: flex; flex-wrap: wrap; gap: 2px; }
.mm-mbtn { width: 30px; height: 30px; display: inline-flex; align-items: center; justify-content: center; padding: 0; border: 1px solid transparent; border-radius: var(--radius-s); background: none; cursor: pointer; }
.mm-mbtn:hover { background: var(--hover-soft); }
.mm-mbtn.on { border-color: var(--prog); background: var(--prog-soft); }
.mm-themes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; padding: 2px 0 8px; }
.mm-theme { display: flex; flex-direction: column; align-items: stretch; gap: 3px; padding: 3px 3px 4px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); color: var(--text-2); font: inherit; font-size: var(--fs-xs); cursor: pointer; }
.mm-theme:hover { border-color: var(--line-strong); }
.mm-theme.on { border-color: var(--prog); box-shadow: 0 0 0 1px var(--prog); color: var(--prog-strong); }
.mm-theme-pic { display: block; width: 100%; height: auto; border-radius: var(--radius-xs); }

/* presenting – content: the map on its own background, a dark bar over it in both themes */
.mm-present { position: fixed; inset: 0; z-index: 900; display: flex; flex-direction: column; outline: none; cursor: pointer; }
.mmp-svg { flex: 1; min-height: 0; width: 100%; height: 100%; display: block; }
.mmp-bar { position: absolute; left: 50%; bottom: 18px; transform: translateX(-50%); display: flex; align-items: center; gap: 2px; padding: 4px; border-radius: var(--radius-pill); background: rgba(22, 24, 30, 0.78); color: #f2f3f6; opacity: 0.35; transition: opacity 0.2s; cursor: default; /* content */ }
.mmp-bar:hover, .mmp-bar:focus-within { opacity: 1; }
.mmp-label { min-width: 160px; max-width: 50vw; padding: 0 10px; overflow: hidden; text-overflow: ellipsis; white-space: pre; text-align: center; font-size: var(--fs); }
.mmp-btn { width: 34px; height: 32px; display: inline-flex; align-items: center; justify-content: center; padding: 0; border: 0; border-radius: var(--radius-pill); background: none; color: inherit; cursor: pointer; }
.mmp-btn:hover { background: rgba(255, 255, 255, 0.14); /* content */ }
.mmp-btn:focus-visible { outline: 2px solid var(--sel); }

/* the AI windows (mind/ai.js) */
.mm-ai-for { display: flex; align-items: baseline; gap: 8px; min-width: 0; }
.mm-ai-for b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.mm-ai-in { width: 100%; resize: vertical; }
.mm-ai-text { min-height: 90px; }
.mm-ai-ideas { display: flex; flex-direction: column; gap: 2px; min-height: 0; overflow: auto; padding: 4px 0; }
.mm-ai-idea { display: flex; align-items: flex-start; gap: 8px; padding: 4px 6px; border-radius: var(--radius-s); cursor: pointer; font-size: var(--fs); line-height: 1.35; }
.mm-ai-idea:hover { background: var(--hover-soft); }
.mm-ai-idea.sub { padding-left: 30px; font-size: var(--fs-m); color: var(--text-2); }
.mm-ai-idea input { margin-top: 2px; flex: none; }
.mm-ai-stage { display: flex; align-items: center; justify-content: center; min-height: 200px; overflow: auto; }
.mm-ai-pic { max-width: 100%; max-height: 100%; height: auto; display: block; border-radius: var(--radius-s); }

/* dropping files */
body.dragging #mm-stage { box-shadow: inset 0 0 0 3px var(--prog); }
.small { font-size: var(--fs-s); }

@media (max-width: 760px) {
  #main { flex-direction: column; }
  #mm-left { width: auto; height: 180px; border-right: 0; border-bottom: 1px solid var(--line); order: 2; }
  #mm-center { order: 1; min-height: 0; }
}
