.mindmap-open .main-canvas { width: 100%; max-width: none; padding: calc(76px + env(safe-area-inset-top)) 12px calc(88px + env(safe-area-inset-bottom)); }
.mindmap-open { overflow: hidden; }
.mindmap-app { display: flex; flex-direction: column; height: calc(100dvh - 164px - env(safe-area-inset-top) - env(safe-area-inset-bottom)); min-height: 360px; }
.mm-header { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 0 4px 16px; }
.mm-header h1 { margin: 0; font: 400 32px/1.2 var(--font-head); letter-spacing: -0.025em; }
.mm-header p { margin: 6px 0 0; color: var(--muted); font-size: 13px; }
.mm-board-controls { display: flex; align-items: center; gap: 8px; min-width: 0; }
.mm-board-controls select { max-width: 220px; width: 180px; padding: 11px 30px 11px 12px; background: #fff; border: 1px solid var(--outline-soft); border-radius: 10px; color: var(--primary-deep); font-size: 14px; text-overflow: ellipsis; }
.mm-button, .mm-icon-button, .mm-tool, .mm-zoom-number { display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; gap: 8px; min-height: 44px; border: 0; border-radius: 10px; background: transparent; color: var(--primary-deep); font-size: 13px; font-weight: 700; transition: background 160ms ease; }
.mm-button { padding: 10px 14px; background: var(--surface-low); }
.mm-button.primary, .mm-new-board { background: var(--primary); color: #fff; }
.mm-button svg, .mm-tool svg, .mm-icon-button svg, .mm-grab svg, .mm-card-menu svg, .mm-external svg { width: 20px; height: 20px; flex-shrink: 0; }
.mm-button.danger { color: #963a32; background: #fae7e3; }
.mm-icon-button { width: 44px; padding: 10px; }
.mm-tool { padding: 10px 12px; }
.mm-toolbar { display: flex; align-items: center; gap: 2px; padding: 6px; background: #fff; border: 1px solid #e3e3df; border-radius: 14px 14px 0 0; overflow-x: auto; scrollbar-width: thin; }
.mm-toolbar button:disabled, .mm-icon-button:disabled { opacity: .4; cursor: default; }
.mm-history { display: flex; margin-left: auto; padding-left: 8px; border-left: 1px solid #e3e3df; }
.mm-selection { display: flex; align-items: center; gap: 4px; min-height: 48px; padding: 2px 10px; border: 1px solid #e3e3df; border-top: 0; background: #f6f5f1; overflow-x: auto; scrollbar-width: thin; color: var(--muted); font-size: 12px; }
.mm-selection > span { flex-shrink: 0; padding-right: 8px; }
.mm-selection-label { max-width: 200px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mm-selection .mm-button { min-height: 40px; padding: 8px 10px; background: transparent; font-size: 12px; }
.mm-selection .mm-icon-button { width: 40px; min-height: 40px; }
.mm-viewport { position: relative; flex: 1; min-height: 160px; overflow: hidden; isolation: isolate; touch-action: none; background-color: #faf9f6; background-image: radial-gradient(circle, #d1d2cb 1px, transparent 1px); background-size: 24px 24px; border: 1px solid #e3e3df; border-top: 0; border-radius: 0 0 14px 14px; user-select: none; cursor: default; }
.mm-world { position: absolute; left: 0; top: 0; width: 0; height: 0; transform-origin: 0 0; }
.mm-connections { position: absolute; top: 0; left: 0; width: 1px; height: 1px; overflow: visible; }
.mm-edge { fill: none; stroke: #8596a2; stroke-width: 2; pointer-events: none; }
.mm-edge-hit { fill: none; stroke: transparent; stroke-width: 20; cursor: pointer; }
.mm-connections text { font: 600 13px var(--font-ui); fill: var(--primary-deep); paint-order: stroke; stroke: var(--surface); stroke-width: 5px; stroke-linejoin: round; }
.mm-connections g:focus { outline: none; }
.mm-connections g:focus .mm-edge, .mm-connections g:hover .mm-edge { stroke: var(--primary-deep); stroke-width: 3; }
.mm-item { --mm-paper: #fff; --mm-ink: #3c443f; position: absolute; display: flex; flex-direction: column; min-width: 180px; min-height: 110px; background: var(--mm-paper); color: var(--mm-ink); border-radius: 12px; box-shadow: 0 5px 16px rgb(58 62 51 / .09); cursor: default; }
.colour-sand { --mm-paper: #f3e5cd; --mm-ink: #5f4c30; }
.colour-sage { --mm-paper: #e3ecdf; --mm-ink: #435a40; }
.colour-blue { --mm-paper: #e1eaf1; --mm-ink: #3d5368; }
.colour-rose { --mm-paper: #f4e2e2; --mm-ink: #754b4d; }
.mm-item.selected, .mm-item.connecting { outline: 2px solid var(--primary); outline-offset: 3px; }
.mm-card-head { display: flex; align-items: center; flex-shrink: 0; height: 42px; padding: 2px 7px 2px 12px; gap: 4px; }
.mm-grab { display: flex; align-items: center; gap: 8px; width: calc(100% - 36px); min-width: 0; height: 38px; padding: 0; border: 0; background: transparent; color: inherit; text-align: left; font-size: 12px; font-weight: 700; cursor: default; touch-action: none; }
.mm-grab span { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.mm-grab svg { width: 17px; height: 17px; }
.mm-card-menu { display: grid; place-items: center; width: 36px; min-height: 36px; padding: 6px; color: inherit; background: transparent; border: 0; border-radius: 8px; }
.mm-card-content { flex: 1; min-height: 0; display: flex; flex-direction: column; padding: 8px 18px 22px; overflow: auto; scrollbar-width: thin; overscroll-behavior: contain; }
.mm-written { white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.75; font-size: 18px; user-select: text; }
.mm-sticky .mm-written { font: 400 21px/1.5 var(--font-head); }
.mm-paper-writing { flex: 1; width: 100%; min-height: 1.75em; padding: 0; color: inherit; font-family: var(--font-ui); cursor: text; }
.mindmap-app [data-mm-inline] { border: 0 !important; border-radius: 0; background: transparent !important; box-shadow: none !important; outline: none !important; caret-color: var(--mm-ink); user-select: text; white-space: pre-wrap; overflow-wrap: anywhere; }
/* Keep an already-open older editor plain during a release update. */
.mindmap-app textarea[data-mm-inline] { appearance: none; flex: 1; width: 100%; padding: 0; resize: none; color: inherit; font: inherit; }
.mm-item:focus-within { outline: 2px solid var(--primary); outline-offset: 3px; }
.mm-group { background: color-mix(in srgb, var(--mm-paper) 50%, transparent); border: 1px dashed color-mix(in srgb, var(--mm-ink) 45%, transparent); box-shadow: none; min-width: 240px; }
.mm-group .mm-grab { font-size: 16px; }
.mm-group .mm-card-content { pointer-events: none; }
.mm-group-count { font-size: 12px; }
.mm-group-help { max-width: 32ch; margin: 10px 0 0; font-size: 12px; line-height: 1.6; }
.mm-resize { position: absolute; right: 2px; bottom: 2px; display: grid; place-items: center; width: 32px; height: 32px; padding: 7px; color: inherit; background: transparent; border: 0; border-radius: 8px; cursor: nwse-resize; touch-action: none; opacity: .65; }
.mm-resize svg { width: 16px; height: 16px; }
.mm-check-rows { display: flex; flex-direction: column; gap: 6px; }
.mm-check { display: flex; align-items: flex-start; gap: 8px; min-width: 0; min-height: 32px; font-size: 16px; line-height: 1.75; }
.mm-check-toggle { position: relative; display: flex; flex-shrink: 0; align-items: flex-start; justify-content: center; width: 24px; height: 32px; padding-top: 4px; color: inherit; cursor: pointer; }
.mm-check-input { position: absolute; inset: 0; width: 24px; height: 32px; margin: 0; opacity: 0; cursor: pointer; }
.mm-check-toggle svg { width: 20px; height: 20px; pointer-events: none; }
.mm-check-mark { opacity: 0; }
.mm-check-input:checked + svg .mm-check-mark { opacity: 1; }
.mm-check-toggle:has(input:focus-visible) { outline: 2px solid var(--primary); outline-offset: 2px; border-radius: 4px; }
.mm-check-text { min-width: 0; flex: 1; min-height: 28px; padding: 0; font: inherit; color: inherit; cursor: text; }
.mm-check.done .mm-check-text { text-decoration: line-through; opacity: .7; }
.mm-check-add, .mm-check-remove { display: none !important; }
.mm-image .mm-card-content, .mm-link .mm-card-content { padding: 0 0 12px; }
.mm-image-content { position: relative; flex: 1; min-height: 0; display: grid; place-items: center; padding: 0 10px 8px; }
.mm-image-content img { width: 100%; height: 100%; object-fit: contain; min-height: 0; border-radius: 4px; }
.mm-image-state { padding: 18px; text-align: center; line-height: 1.6; font-size: 13px; }
.mm-image-state[data-mm-retry-image] { cursor: pointer; }
.mm-link-preview { position: relative; flex: 1; min-height: 80px; width: 100%; padding: 0; border: 0; background: #edece7; color: var(--primary-deep); overflow: hidden; cursor: pointer; }
.mm-link-preview img { width: 100%; height: 100%; object-fit: cover; display: block; }
.mm-link-brand { display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 8px; padding: 20px; height: 100%; }
.mm-link-brand > svg { width: 36px; height: 36px; }
.mm-link-brand > strong { font-size: 20px; }
.mm-link-brand > small { font-size: 12px; }
.mm-play-badge { display: grid; place-items: center; position: absolute; left: calc(50% - 24px); top: calc(50% - 24px); width: 48px; height: 48px; border-radius: 50%; background: rgb(255 255 255 / .94); box-shadow: 0 5px 14px rgb(0 0 0 / .16); }
.mm-play-badge svg { width: 26px; height: 26px; }
.mm-link-copy { flex-shrink: 0; padding: 12px 16px 4px; }
.mm-link-copy > strong { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-size: 14px; line-height: 1.5; }
.mm-link-copy > p { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-size: 12px; line-height: 1.5; margin: 5px 0 0; }
.mm-external { display: flex; align-items: center; gap: 5px; margin-top: 8px; font-size: 11px; text-decoration: underline; text-underline-offset: 3px; }
.mm-external svg { width: 14px; height: 14px; }
.mm-empty { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); width: min(90%, 450px); padding: 24px; text-align: center; pointer-events: none; }
.mm-empty h2 { margin: 0; font: 400 30px/1.4 var(--font-head); text-wrap: balance; color: var(--primary-deep); }
.mm-empty p { margin: 16px 0 20px; color: var(--muted); font-size: 14px; line-height: 1.75; }
.mm-empty button { pointer-events: auto; }
.mm-canvas-controls { position: absolute; inset: auto 14px 14px; display: flex; justify-content: space-between; gap: 8px; pointer-events: none; }
.mm-modes, .mm-zoom-controls { display: flex; align-items: center; padding: 3px; background: #fff; border-radius: 12px; box-shadow: 0 4px 16px rgb(58 62 51 / .1); pointer-events: auto; }
.mm-modes .active { background: var(--primary-soft); color: var(--primary-deep); }
.mm-zoom-number { min-width: 48px; font-size: 12px; font-variant-numeric: tabular-nums; }
.mm-footer { display: flex; justify-content: space-between; gap: 16px; min-height: 32px; padding: 8px 4px 0; color: var(--muted); font-size: 11px; }
.mm-save-status { display: inline-flex; align-items: center; gap: 7px; padding: 0; color: inherit; font-size: inherit; background: transparent; border: 0; text-align: left; }
.mm-status-dot { flex-shrink: 0; width: 6px; height: 6px; border-radius: 50%; background: #8b7860; }
.mm-save-status[data-state=synced] .mm-status-dot { background: #54714e; }
.mm-save-status[data-state=error] { color: #963a32; }
.mm-save-status[data-state=error] .mm-status-dot { background: #963a32; }
.mm-toast { position: fixed; z-index: 400; left: 50%; bottom: calc(108px + env(safe-area-inset-bottom)); transform: translateX(-50%); width: max-content; max-width: calc(100vw - 32px); padding: 12px 18px; background: var(--primary-deep); color: #fff; border-radius: 10px; box-shadow: 0 6px 24px rgb(37 52 79 / .14); font-size: 13px; line-height: 1.5; }
.mm-form .field { min-width: 0; }
.mm-form .field input, .mm-form .field textarea, .mm-form .field select { width: 100%; caret-color: var(--primary); }
.mm-form svg { width: 20px; height: 20px; }
.mm-form-error { padding: 10px; color: #963a32; background: #fae7e3; border-radius: 8px; font-size: 13px; }
.mm-field-help { margin: -8px 0 0; color: var(--muted); line-height: 1.6; font-size: 13px; }
.mm-board-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.mm-player { width: min(760px, calc(100vw - 32px)); max-height: calc(100dvh - 32px); padding: 20px; border: 0; border-radius: 16px; color: var(--ink); background: var(--surface); box-shadow: 0 20px 60px rgb(0 0 0 / .2); }
.mm-player::backdrop { background: rgb(26 28 26 / .5); }
.mm-player-tiktok, .mm-player-instagram { width: min(440px, calc(100vw - 24px)); }
.mm-player-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.mm-player-head h2 { margin: 0; font: 400 21px/1.4 var(--font-head); overflow-wrap: anywhere; }
.mm-player-frame { width: 100%; aspect-ratio: 16 / 9; background: #e9e8e5; }
.mm-player-tiktok .mm-player-frame, .mm-player-instagram .mm-player-frame { height: min(65dvh, 610px); aspect-ratio: auto; }
.mm-player iframe { width: 100%; height: 100%; border: 0; }
.mm-player-footer { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: space-between; margin-top: 12px; }
.mm-player-footer p { max-width: 35ch; margin: 0; font-size: 12px; line-height: 1.6; color: var(--muted); }
.mindmap-app ::selection, .mm-form ::selection { background: var(--primary-soft); color: var(--primary-deep); }
.mindmap-app :focus-visible, .mm-form :focus-visible, .mm-player :focus-visible { outline: 2px solid var(--primary); outline-offset: 3px; }
.mm-viewport:focus-visible { outline-offset: -3px; }
.mindmap-app [hidden], .mm-form [hidden] { display: none !important; }
@media (hover: hover) { .mm-button:hover, .mm-icon-button:not(:disabled):hover, .mm-tool:not(:disabled):hover, .mm-card-menu:hover { background: #e5e9eb; color: var(--primary-deep); } .mm-button.primary:hover, .mm-new-board:hover { background: var(--primary-deep); color: #fff; } }
.mm-placed { animation: mm-place 240ms cubic-bezier(.16, 1, .3, 1); }
@keyframes mm-place { from { transform: translateY(-8px) rotate(-1deg); box-shadow: 0 14px 24px rgb(58 62 51 / .14); } to { transform: translateY(0) rotate(0); } }
@media (min-width: 920px) { .mindmap-open .main-canvas { padding: 24px 28px 114px; } .mindmap-app { height: calc(100dvh - 138px); } .mm-header { padding-right: 80px; } .mm-header h1 { font-size: 36px; } }
@media (max-width: 650px) { .mm-header { flex-wrap: wrap; gap: 10px; padding-bottom: 12px; } .mm-header h1 { font-size: 27px; } .mm-header p { display: none; } .mm-board-controls { width: 100%; } .mm-board-controls select { flex: 1; width: 0; max-width: none; } .mm-new-board { font-size: 12px; padding: 8px 11px; } .mm-toolbar { flex-shrink: 0; } .mm-tool { flex-direction: column; gap: 4px; font-size: 10px; min-width: 56px; padding: 6px 8px; } .mm-history { padding-left: 4px; } .mm-history .mm-icon-button { width: 36px; } .mm-selection { min-height: 44px; } .mm-selection-label { max-width: 80px; } .mm-empty { padding: 12px; } .mm-empty h2 { font-size: 24px; } .mm-empty p { font-size: 12px; margin: 12px 0 16px; } .mm-hint { display: none; } .mm-canvas-controls { inset: auto 8px 8px; } .mm-canvas-controls .mm-icon-button { width: 36px; min-height: 40px; padding: 8px; } .mm-zoom-number { min-width: 44px; } .mm-player { padding: 14px; } }
@media (prefers-reduced-motion: reduce) { .mm-placed { animation: none; } .mindmap-app button { transition: none; } }
