/* Wah-Kit shared mind maps (/mindmap/ and /mm/<code>) */
.mm-loading { color: var(--muted); padding: 30px 0; text-align: center; }
.mm-err { color: #A3140F; font-size: 14px; margin: 6px 0 0; }
.mm-err:empty { display: none; }
.mm-hint { font-size: 13px; color: var(--muted); margin: 6px 0 0; }
.mm-up { background: #FFF6DB; border: 1px solid #F6D98B; border-radius: 10px; padding: 8px 10px; font-size: 13.5px; margin: 8px 0; }

/* ---------- My mind maps ---------- */
.mmh-intro { padding: 18px 0 12px; }
.mmh-intro h1 { font-size: clamp(24px, 3.4vw, 32px); }
.mmh-intro p { margin: 4px 0 0; max-width: 820px; }
.mmh { display: flex; flex-direction: column; gap: 16px; }
.mmh-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.mmh-card h2 { font-size: 19px; margin: 0 0 10px; }
.mmh-new { display: flex; gap: 8px; flex-wrap: wrap; }
.mmh-new input { flex: 1 1 260px; height: 46px; border: 1px solid var(--line); border-radius: 12px; padding: 0 12px; font: 16px var(--font-body); }
.mmh-list { display: flex; flex-direction: column; gap: 8px; }
.mmh-item { display: grid; grid-template-columns: 1fr auto; grid-template-rows: auto auto; gap: 2px 12px; align-items: center; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; }
.mmh-item.off { opacity: .7; }
.mmh-item .btn { grid-row: span 2; min-height: 40px; }
.mmh-t { display: flex; gap: 8px; align-items: center; text-decoration: none; color: var(--ink); font-size: 16px; }
.mmh-item small { color: var(--muted); font-size: 13px; }
.how { margin-top: 26px; max-width: 860px; color: var(--ink-soft); }
.how h2 { font-size: 22px; color: var(--ink); margin-bottom: 8px; }
.how ol { padding-left: 22px; margin: 0; }
.how li { margin: 4px 0; }

/* ---------- a map: fills the screen under the header ---------- */
body.mm-page { overflow: hidden; }
body.mm-page .wk-appbar, body.mm-page .wk-ask { display: none !important; }
.mm { display: flex; flex-direction: column; height: calc(100vh - 66px); height: calc(100dvh - 66px); position: relative; }
.mm-gone { max-width: 560px; margin: 40px auto; padding: 24px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); text-align: center; display: flex; flex-direction: column; gap: 10px; align-items: center; }
.mm-gone input { height: 46px; width: 180px; text-align: center; font: 22px var(--font-body); letter-spacing: 6px; border: 1px solid var(--line); border-radius: 12px; }
.mm-top { display: flex; align-items: center; gap: 10px; padding: 8px 16px; background: var(--surface); border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.mm-tl { flex: 1 1 200px; min-width: 0; }
.mm-title { font-size: 19px; margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mm-status { margin: 0; font-size: 13px; min-height: 0; }
.mm-status:empty { display: none; }
.mm-status.ok { color: #0F6B3E; } .mm-status.err { color: #A3140F; }
.mm-people { display: flex; cursor: pointer; }
.mm-av { width: 30px; height: 30px; border-radius: 50%; color: #fff; display: grid; place-items: center; font: 700 12px var(--font-body); border: 2px solid #fff; margin-left: -6px; position: relative; flex: none; }
.mm-av:first-child { margin-left: 0; }
.mm-av.on::after { content: ''; position: absolute; right: -2px; bottom: -2px; width: 10px; height: 10px; border-radius: 50%; background: #22C55E; border: 2px solid #fff; }
.mm-av.more { background: #9CA3AF; }
.mm-seg { display: inline-flex; border: 1px solid var(--line); border-radius: 12px; padding: 3px; background: var(--ground); gap: 3px; flex-wrap: wrap; }
.mm-seg button { min-height: 36px; padding: 0 12px; border: 0; border-radius: 9px; background: none; font: 700 13.5px var(--font-body); color: var(--ink-soft); cursor: pointer; }
.mm-seg button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 4px rgba(29,26,57,.15); }
.mm-seg button:disabled { opacity: .45; cursor: default; }
.mm-seg.wide { display: flex; }
.mm-share { min-height: 40px; }
.mm-ibtn { width: 40px; height: 40px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); font-size: 20px; cursor: pointer; }
.mm-joinbar { display: flex; align-items: center; justify-content: center; gap: 12px; padding: 8px 16px; background: #FFF6DB; border-bottom: 1px solid #F6D98B; font-size: 14.5px; flex-wrap: wrap; text-align: center; }
.mm-joinbar .btn { min-height: 36px; }
.mm-pane { flex: 1; min-height: 0; position: relative; }
.mm-pane[hidden] { display: none; }

/* the map */
.mm-mapview { background: radial-gradient(circle, #DCDCE8 1px, transparent 1.2px) 0 0 / 22px 22px, #FAFAFD; overflow: hidden; }
.mm-stage { position: absolute; inset: 0; touch-action: none; cursor: grab; outline: none; user-select: none; -webkit-user-select: none; }
.mm-stage:active { cursor: grabbing; }
.mm-world { position: absolute; left: 0; top: 0; transform-origin: 0 0; }
.mm-links { position: absolute; overflow: visible; pointer-events: none; max-width: none; max-height: none; }
.mm-n { position: absolute; box-sizing: border-box; display: flex; align-items: center; padding: 7px 13px; border-radius: 10px; background: #fff; border: 2px solid var(--c); color: var(--ink); font: 15px/20px "Segoe UI", system-ui, -apple-system, Roboto, sans-serif; cursor: pointer; box-shadow: 0 1px 3px rgba(29,26,57,.08); }
.mm-n .tx { white-space: pre; flex: 1; }
.mm-n.lv0 { background: #1D1A39; border-color: #1D1A39; color: #fff; font: 700 20px/26px "Segoe UI", system-ui, -apple-system, Roboto, sans-serif; padding: 12px 20px; border-radius: 16px; justify-content: center; text-align: center; }
.mm-n.lv1 { background: var(--c); color: #fff; }
.mm-n.sel { box-shadow: 0 0 0 3px #fff, 0 0 0 6px #1F5FD1; }
.mm-n.pending { border-style: dashed; opacity: .75; }
.mm-n.tmp { opacity: .85; }
.mm-n.drop { box-shadow: 0 0 0 4px #22C55E; }
.mm-n.drop-before::before, .mm-n.drop-after::after { content: ''; position: absolute; left: -6px; right: -6px; height: 4px; border-radius: 2px; background: #22C55E; }
.mm-n.drop-before::before { top: -9px; } .mm-n.drop-after::after { bottom: -9px; }
.mm-n.lifting { opacity: .35; }
.mm-n.ghost { position: fixed; z-index: 200; pointer-events: none; transform: rotate(-3deg); box-shadow: 0 8px 24px rgba(0,0,0,.25); }
.mm-n .vt { font-size: 12px; font-weight: 700; margin-left: 6px; opacity: .85; }
.mm-n .vt.on { opacity: 1; }
.mm-n .nt { font-size: 12px; margin-left: 4px; }
.mm-n .au { position: absolute; top: -9px; right: -9px; width: 20px; height: 20px; border-radius: 50%; color: #fff; font: 700 9px/20px var(--font-body); text-align: center; border: 2px solid #fff; }
.mm-n .cl { position: absolute; top: 50%; width: 22px; height: 22px; margin-top: -11px; border-radius: 50%; border: 2px solid var(--c); background: #fff; color: var(--ink); font: 700 11px/1 var(--font-body); cursor: pointer; padding: 0; }
.mm-n .cl.r { right: -13px; } .mm-n .cl.l { left: -13px; }
.mm-n.hk-r { padding-right: 22px; } .mm-n.hk-l { padding-left: 22px; }
.mm-zoom { position: absolute; right: 12px; top: 12px; display: flex; flex-direction: column; gap: 4px; }
.mm-zoom button { width: 38px; height: 38px; border: 1px solid var(--line); border-radius: 10px; background: #fff; font-size: 18px; cursor: pointer; box-shadow: 0 1px 4px rgba(29,26,57,.1); }

/* the list */
.mm-listview { outline: none; overflow: auto; padding: 14px 16px 120px; background: var(--ground); }
.mm-ol, .mm-ol ul { list-style: none; margin: 0; padding: 0; }
.mm-ol ul { padding-left: 22px; border-left: 2px solid color-mix(in srgb, var(--c) 35%, transparent); margin-left: 11px; }
.mm-or { display: flex; align-items: center; gap: 6px; padding: 6px 6px; border-radius: 10px; min-height: 38px; }
.mm-ol li.sel > .mm-or { background: #E8EFFD; }
.mm-or .tw { width: 24px; height: 24px; border: 0; background: none; font-size: 14px; color: var(--muted); cursor: pointer; flex: none; }
.mm-or .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--c); flex: none; }
.mm-or .tx { flex: 1; font-size: 16px; cursor: pointer; word-break: break-word; }
.mm-or .tx.root { font-weight: 800; font-size: 19px; }
.mm-or .vt { font-size: 13px; font-weight: 700; }
.mm-or .au { width: 22px; height: 22px; border-radius: 50%; color: #fff; font: 700 9px/22px var(--font-body); text-align: center; flex: none; }
.mm-or .pd { font-size: 11px; background: #FFF6DB; border-radius: 6px; padding: 1px 6px; }
.mm-or .add { width: 34px; height: 34px; border: 1px solid var(--line); border-radius: 10px; background: #fff; font-size: 16px; cursor: pointer; flex: none; }
.mm-ol li.pending > .mm-or .tx { opacity: .7; font-style: italic; }
.mm-addbig { margin-top: 12px; width: 100%; min-height: 46px; border: 1px dashed #b9b8cc; border-radius: 12px; background: #fff; font: 700 15px var(--font-body); cursor: pointer; }

/* the box for typing an idea */
.mm-edit { position: absolute; z-index: 150; box-sizing: border-box; border: 2px solid #1F5FD1; border-radius: 10px; padding: 7px 11px; font: 16px/20px "Segoe UI", system-ui, -apple-system, Roboto, sans-serif; resize: none; overflow: hidden; background: #fff; color: var(--ink); box-shadow: 0 6px 20px rgba(29,26,57,.2); outline: none; }

/* the toolbar for the selected idea */
.mm-tools { position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%); z-index: 60; background: #fff; border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 10px 30px rgba(29,26,57,.18); padding: 8px 10px; max-width: calc(100vw - 20px); box-sizing: border-box; }
.mm-tools[hidden] { display: none; }
.mm-tinfo { font-size: 13px; padding: 0 4px 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--ink-soft); }
.mm-tbtns { display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; }
.mm-tbtns button { display: flex; flex-direction: column; align-items: center; gap: 1px; min-width: 54px; padding: 5px 4px; border: 0; border-radius: 10px; background: none; cursor: pointer; color: var(--ink); flex: none; }
.mm-tbtns button:hover:not(:disabled) { background: var(--ground); }
.mm-tbtns button:disabled { opacity: .3; cursor: default; }
.mm-tbtns button.on { background: #E8EFFD; }
.mm-tbtns button.danger .l { color: #A3140F; }
.mm-tbtns .i { font-size: 18px; line-height: 22px; }
.mm-tbtns .l { font: 600 11px var(--font-body); }

/* pop-ups */
.mm-dlg { border: 0; border-radius: 18px; padding: 18px; width: min(440px, calc(100vw - 24px)); box-sizing: border-box; box-shadow: 0 20px 50px rgba(0,0,0,.25); max-height: calc(100dvh - 30px); }
.mm-dlg.wide { width: min(600px, calc(100vw - 24px)); }
.mm-dlg::backdrop { background: rgba(29,26,57,.45); }
.mm-dh { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 8px; }
.mm-dh h2 { flex: 1; font-size: 19px; margin: 0; }
.mm-dlg h3 { font-size: 15px; margin: 16px 0 6px; }
.mm-x { width: 34px; height: 34px; border: 0; border-radius: 10px; background: var(--ground); cursor: pointer; font-size: 15px; flex: none; }
.mm-dlg input[type=text], .mm-dlg textarea { width: 100%; box-sizing: border-box; border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; font: 16px var(--font-body); margin-top: 8px; }
.mm-dlg input.mm-pin { width: 90px; margin: 0; letter-spacing: 4px; text-align: center; }
.mm-row { display: flex; gap: 8px; justify-content: flex-end; margin-top: 12px; flex-wrap: wrap; align-items: center; }
.mm-row.left { justify-content: flex-start; }
.mm-mini { min-height: 34px; padding: 0 10px; border: 1px solid var(--line); border-radius: 9px; background: #fff; font: 700 13px var(--font-body); cursor: pointer; }
.btn.danger { color: #A3140F; }
.mm-check { display: flex; gap: 8px; align-items: center; font-size: 14.5px; margin-top: 10px; cursor: pointer; }
.mm-check input { width: 18px; height: 18px; }
.mm-menu { display: flex; flex-direction: column; }
.mm-mi { display: flex; flex-direction: column; text-align: left; border: 0; background: none; padding: 11px 10px; border-radius: 10px; font: 15px var(--font-body); color: var(--ink); cursor: pointer; }
.mm-mi:hover { background: var(--ground); }
.mm-mi small { color: var(--muted); font-size: 12.5px; }
.mm-link { display: flex; gap: 8px; align-items: center; }
.mm-link input { margin: 0 !important; font-size: 14px !important; }
.mm-qrwrap { display: flex; gap: 14px; align-items: center; margin-top: 14px; border-top: 1px solid var(--line); padding-top: 14px; }
.mm-qr { width: 150px; height: 150px; flex: none; image-rendering: pixelated; }
.mm-qrfull { position: fixed; inset: 0; z-index: 300; background: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; text-align: center; padding: 20px; cursor: pointer; }
.mm-qrfull h2 { font-size: clamp(22px, 4vw, 40px); margin: 0; }
.mm-qrfull p { font-size: clamp(16px, 2.4vw, 24px); margin: 0; }
.mm-qrbig { width: min(70vw, 70vh); height: min(70vw, 70vh); image-rendering: pixelated; }
.mm-plist, .mm-hist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; max-height: 50vh; overflow: auto; }
.mm-plist li { display: flex; align-items: center; gap: 10px; }
.mm-plist .mm-av { margin: 0; }
.mm-plist .nm { flex: 1; display: flex; flex-direction: column; }
.mm-plist small, .mm-hist small { color: var(--muted); font-size: 12.5px; }
.mm-hist li { display: flex; align-items: center; gap: 8px; justify-content: space-between; font-size: 14px; padding: 6px 0; border-bottom: 1px solid var(--ground); }
.mm-pop { position: absolute; z-index: 220; display: grid; grid-template-columns: repeat(5, 30px); gap: 6px; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 8px; box-shadow: 0 8px 24px rgba(0,0,0,.18); }
.mm-pop button { width: 30px; height: 30px; border-radius: 50%; border: 1px solid rgba(0,0,0,.15); cursor: pointer; }
.mm-pop button.none { background: linear-gradient(135deg, #fff 45%, #E63946 45%, #E63946 55%, #fff 55%) !important; }
.mm-toast { position: fixed; left: 50%; bottom: 120px; transform: translateX(-50%); z-index: 250; background: #1D1A39; color: #fff; border-radius: 12px; padding: 10px 12px 10px 16px; display: flex; gap: 14px; align-items: center; font-size: 14px; box-shadow: 0 8px 24px rgba(0,0,0,.3); }
.mm-toast button { border: 0; background: #FFD166; color: #1D1A39; font: 700 14px var(--font-body); border-radius: 8px; padding: 6px 12px; cursor: pointer; }
.mm-listtext { font: 14px/1.5 ui-monospace, Consolas, monospace !important; }

@media (max-width: 760px) {
  .mm { height: calc(100vh - 58px); height: calc(100dvh - 58px); }
  .mm-top { padding: 6px 10px; gap: 6px; }
  .mm-tl { flex-basis: 100%; order: -1; }
  .mm-title { font-size: 17px; }
  .mm-people { margin-right: auto; }
  .mm-seg button { padding: 0 10px; min-height: 34px; }
  .mm-share { padding: 0 12px; min-height: 38px; }
  .mm-tools { left: 6px; right: 6px; transform: none; bottom: 8px; max-width: none; padding: 6px; }
  .mm-tbtns button { min-width: 50px; }
  .mm-qrwrap { flex-direction: column; align-items: flex-start; }
  .mm-toast { bottom: 110px; }
}

.mm-paused { position: absolute; left: 50%; top: 90px; transform: translateX(-50%); z-index: 70; border: 0; border-radius: 999px; background: #1D1A39; color: #fff; padding: 10px 18px; font: 600 14px var(--font-body); cursor: pointer; box-shadow: 0 8px 24px rgba(0,0,0,.25); max-width: calc(100vw - 30px); }

/* who added an idea, and when: shown on hover (computers) or when the idea is selected */
.mm-n .by { position: absolute; left: 0; top: calc(100% + 5px); z-index: 5; white-space: nowrap; font: 600 11.5px/1 var(--font-body); color: #fff; background: rgba(29,26,57,.82); border-radius: 6px; padding: 4px 7px; pointer-events: none; opacity: 0; transform: translateY(-3px); transition: opacity .12s, transform .12s; }
.mm-n:hover .by, .mm-n.sel .by { opacity: 1; transform: none; }
.mm-n.ghost .by { display: none; }
.mm-or .by { font-size: 12px; color: var(--muted); white-space: nowrap; display: none; }
.mm-ol li:hover > .mm-or .by, .mm-ol li.sel > .mm-or .by { display: inline; }
