/* Carte de mémoire : le paysage, les fontes et les icônes restent ceux de Summit. */
body[data-view="memory"] main:has(.has-memory-map) { max-width: 1480px; padding: 0 48px 48px; }
.has-memory-map { --mg-blue: #315bfa; --mg-teal: #55aaa4; --mg-purple: #9670dc; --mg-amber: #c58b25; --mg-edge: #9eafd2; gap: 12px; }
.mg-head { display: flex; flex-direction: column; align-items: stretch; justify-content: flex-start; max-width: none; width: 100%; margin: 0; padding: 18px 4px 0; }
.mg-breadcrumb { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 14px; }
.mg-heading { display: flex; align-items: center; justify-content: space-between; gap: 28px; margin-top: 6px; }
.mg-heading h1 { margin: 0; font-size: 38px; line-height: 1.15; font-weight: 800; letter-spacing: -1.4px; }
.mg-heading .me-lead { margin-top: 8px !important; font-size: 14px; }
.mg-tools { display: flex; align-items: center; flex: 0 1 540px; gap: 14px; }
.mg-tools .me-search { flex: 1; min-width: 0; min-height: 46px; }
.mg-tools .me-search input { min-height: 44px; font-size: 14px; }
.mg-list-toggle.me-btn { width: auto; flex-shrink: 0; min-height: 46px; background: var(--nav-glass-hi); border: 1px solid var(--nav-edge); color: var(--muted) !important; }
.mg-legend { display: flex; gap: 22px; flex-wrap: wrap; padding: 0 4px; }
.mg-legend-item { display: inline-flex; align-items: center; gap: 9px; min-height: 44px; margin: 0; padding: 0 2px; border: 0; border-radius: 12px; background: transparent; box-shadow: none; color: var(--muted); font: inherit; font-size: 13px; font-weight: 650; cursor: pointer; }
.mg-legend-item:hover { color: var(--ink); background: transparent; }
.mg-legend-item[aria-pressed="true"] { color: var(--ink); text-decoration: underline; text-underline-offset: 6px; }
.mg-dot { display: block; flex: 0 0 14px; width: 14px; height: 14px; border-radius: 50%; background: var(--mg-blue); box-shadow: 0 0 0 2px var(--page); }
.is-seen > .mg-dot { background: var(--mg-teal); }
.is-deal > .mg-dot { background: var(--mg-purple); }
.is-guess > .mg-dot { background: var(--page); border: 2px dashed var(--mg-amber); }
.mg-status { padding-inline: 4px; color: var(--muted); font-size: 12px; line-height: 1.5; }
.mg-status:empty { display: none; }
.mg-stage { position: relative; isolation: isolate; width: 100%; height: clamp(540px, calc(100svh - 420px), 780px); overflow: hidden; touch-action: none; cursor: grab; border-radius: 24px; }
.mg-stage:focus-visible { outline: 2px solid var(--mg-blue); outline-offset: 3px; }
.mg-stage.is-dragging, .mg-stage.is-dragging * { cursor: grabbing; user-select: none; }
.mg-world { position: absolute; left: 0; top: 0; transform-origin: 0 0; will-change: transform; }
.mg-world > svg { position: absolute; inset: 0; overflow: visible; pointer-events: none; }
.mg-edge { fill: none; stroke: var(--mg-edge); stroke-width: 1; opacity: .58; transition: stroke .15s, opacity .15s; }
.mg-edge.is-hypothesis, .mg-edge.is-conflict { stroke: var(--mg-amber); stroke-dasharray: 5 5; opacity: .8; }
.mg-edge.is-active { stroke: var(--mg-blue); stroke-width: 1.8; opacity: 1; }
.mg-edge.is-active.is-conflict, .mg-edge.is-active.is-hypothesis { stroke: var(--mg-amber); }
.mg-group { position: absolute; display: block; color: var(--muted); opacity: .48; font-size: 20px; font-weight: 750; letter-spacing: -.6px; pointer-events: none; white-space: nowrap; }
.mg-node { position: absolute; z-index: 1; display: flex; align-items: center; gap: 10px; min-height: calc(44px * var(--mg-inverse-scale, 1)); margin: 0; padding: 2px 8px 2px 0; border: 0; border-radius: 22px; background: transparent; box-shadow: none; color: var(--ink); font: inherit; font-size: calc(14px * var(--mg-inverse-scale, 1)); line-height: 1.3; font-weight: 650; text-align: left; transform: translate(-7px, -50%); cursor: pointer; transition: opacity .15s, background .15s; }
.mg-node:hover { z-index: 3; background: var(--nav-glass-hi); box-shadow: none; color: var(--ink); }
.mg-node:focus-visible { z-index: 4; outline: 2px solid var(--mg-blue); outline-offset: 4px; }
.mg-node .mg-node-label { display: -webkit-box; overflow: hidden; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow-wrap: normal; text-shadow: 0 1px 5px var(--page), 0 -1px 5px var(--page); }
.mg-node.is-context { font-size: calc(12.5px * var(--mg-inverse-scale, 1)); font-weight: 550; }
.mg-node.is-context .mg-dot { flex-basis: 10px; width: 10px; height: 10px; margin-inline: 2px; }
.mg-node.is-muted { opacity: .84; }
.mg-node.is-contextual { opacity: .6; }
.mg-node.is-selected { z-index: 4; min-height: calc(48px * var(--mg-inverse-scale, 1)); font-size: calc(15px * var(--mg-inverse-scale, 1)); font-weight: 800; background: var(--nav-glass-hi); box-shadow: 0 3px 18px -10px #315bfa66; }
.mg-node.is-selected > .mg-dot { flex-basis: 20px; width: 20px; height: 20px; margin-left: -3px; box-shadow: 0 0 0 4px var(--page), 0 0 0 10px #315bfa17; }
.mg-preview { position: absolute; z-index: 5; right: 8px; bottom: 8px; width: 290px; max-width: calc(100% - 16px); padding: 15px 20px 8px; border: 1px solid var(--nav-edge); border-radius: 25px; background: var(--nav-glass-hi); box-shadow: 0 18px 50px -30px #1b3e7859; backdrop-filter: blur(24px); cursor: default; }
.mg-preview[hidden], .mg-empty[hidden], .mg-more[hidden] { display: none; }
.mg-preview-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.mg-preview-top .me-icon-btn { width: 44px; height: 44px; margin: -8px -12px -4px 0; border: 0; background: transparent; box-shadow: none; }
.mg-preview h2 { margin: 8px 0 8px; font-size: 19px; font-weight: 800; letter-spacing: -.6px; line-height: 1.35; overflow-wrap: anywhere; }
.mg-preview-source { color: var(--muted); font-size: 12.5px; line-height: 1.5; }
.mg-open.me-btn { justify-content: flex-start; flex-direction: row-reverse; width: 100%; margin-top: 14px; padding: 4px 0; min-height: 44px; border-top: 1px solid var(--nt-line); border-radius: 0; color: var(--mg-blue) !important; background: transparent; font-size: 13px; }
.mg-open.me-btn > span { margin-right: auto; }
.mg-footer { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 0 4px; }
.mg-help { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12px; line-height: 1.5; }
.mg-help .wellness-icon { flex-shrink: 0; width: 17px; height: 17px; }
.mg-zoom { display: flex; flex-shrink: 0; gap: 2px; padding: 2px; border-radius: 999px; background: var(--nav-glass-hi); box-shadow: inset 0 0 0 1px var(--nav-edge); }
.mg-zoom .me-icon-btn { border: 0; background: transparent; box-shadow: none; }
.mg-zoom .me-icon-btn:disabled { opacity: .35; cursor: default; }
.mg-bottom { display: flex; align-items: center; gap: 14px; padding: 0 4px; }
.mg-count { flex: 1; color: var(--muted); font-size: 12px; line-height: 1.5; }
.mg-bottom .me-btn { width: auto; min-height: 44px; padding-inline: 14px; font-size: 12px; }
.mg-bottom .mg-manage { background: transparent; }
.mg-empty { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 28px; gap: 16px; text-align: center; cursor: default; }
.mg-empty > .wellness-icon { width: 42px; height: 42px; color: var(--mg-blue); }
.mg-empty h2 { margin: 0; font-size: 22px; }
.mg-empty p { max-width: 420px; color: var(--muted); font-size: 14px; line-height: 1.6; }
.mg-empty .me-btn { width: auto; }
.mg-detail-text { font-size: 15px; line-height: 1.65; overflow-wrap: anywhere; }
.mg-warning { margin-block: 10px !important; color: var(--nt-gold); font-size: 12px; line-height: 1.5; }
.mg-related-title { margin: 8px 0 0; font-size: 15px; }
.mg-detail-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.mg-detail-actions .me-btn { width: auto; min-height: 44px; font-size: 13px; }
.me-memory-switch { display: flex; justify-content: flex-end; }
.me-memory-switch .me-btn { width: auto; min-height: 44px; }
html[data-today-theme="dark"] .has-memory-map { --mg-blue: #75a0ff; --mg-teal: #6cc6b6; --mg-purple: #b99aef; --mg-amber: #e0b45a; --mg-edge: #7691b6; }
@media (max-width: 1100px) {
 .mg-heading { align-items: flex-start; flex-direction: column; gap: 18px; }
 .mg-tools { flex: auto; width: 100%; }
 .mg-stage { height: 620px; }
}
@media (max-width: 760px) {
 body[data-view="memory"] main:has(.has-memory-map) { padding: 0 16px 110px; }
 .mg-head { padding: 6px 0 0; }
 .mg-heading { gap: 16px; margin-top: 2px; }
 .mg-heading h1 { max-width: 310px; font-size: 30px; letter-spacing: -1.1px; }
 .mg-heading .me-lead { font-size: 13px; }
 .mg-tools { gap: 8px; }
 .mg-tools .me-search { padding-inline: 12px; }
 .mg-tools .me-search input { font-size: 13px; }
 .mg-list-toggle.me-btn { padding-inline: 13px; font-size: 13px; }
 .mg-legend { gap: 0 16px; }
 .mg-legend-item { font-size: 11.5px; }
 .mg-dot { flex-basis: 12px; width: 12px; height: 12px; }
 .mg-stage { height: clamp(360px, calc(100svh - 460px), 500px); margin-inline: -8px; width: calc(100% + 16px); background: var(--nt-hair); border-radius: 22px; }
 .mg-preview { right: 8px; bottom: 8px; width: calc(100% - 16px); padding: 12px 16px 4px; }
 .mg-preview h2 { font-size: 17px; margin-top: 4px; }
 .mg-preview .mg-open { margin-top: 8px; }
 .mg-footer { align-items: flex-start; gap: 12px; padding: 0; }
 .mg-help { max-width: 180px; font-size: 11.5px; }
 .mg-zoom .me-icon-btn { width: 44px; height: 44px; }
 .mg-bottom { flex-wrap: wrap; gap: 8px; }
 .mg-count { flex-basis: 100%; font-size: 11.5px; }
 .mg-bottom .mg-manage { margin-left: auto; }
}
@media (prefers-reduced-motion: reduce) { .mg-node,.mg-edge { transition: none; } }
@media (forced-colors: active) { .mg-edge { stroke: CanvasText; }.mg-dot { background: ButtonText; border: 1px solid ButtonText; }.mg-node.is-selected { outline: 2px solid Highlight; }.mg-node.is-muted { opacity: 1; } }
