/* =============================================================
   /memory page — Higgsfield Supercomputer dark theme override
   2026-05-19. Other pages stay cream+coral; only memory goes dark.
   ============================================================= */

/* Force dark background, override v3 cream tokens for this page only */
[data-theme="dark"] .mg-body, [data-theme="dark"].mg-body {
  background: #0E0D0B !important;
  color: #F5F2EA !important;
  min-height: 100vh;
  --bn-bg-page: #0E0D0B;
  --bn-bg-surface-1: #161410;
  --bn-bg-surface-2: #1F1B15;
  --bn-bg-surface-3: #2A251E;
  --bn-ink: #F5F2EA;
  --bn-ink-secondary: #BAB3A4;
  --bn-ink-muted: #928B7B;  /* AA on dark surfaces (#0E0D0B = 5.7:1) */
  --bn-ink-faint: #4A4640;
  --bn-border-soft: rgba(255, 255, 255, 0.04);
  --bn-border: rgba(255, 255, 255, 0.08);
  --bn-border-strong: rgba(255, 255, 255, 0.14);
}

/* Topbar dark glass */
[data-theme="dark"] .mg-body .mg-topbar {
  background: rgba(14, 13, 11, 0.78) !important;
  border-bottom: 1px solid var(--bn-border-soft) !important;
}
[data-theme="dark"] .mg-body .mg-topbar__title,
[data-theme="dark"] .mg-body .mg-topbar__titles .bn-grad-text {
  color: var(--bn-ink) !important;
  background: linear-gradient(135deg, #F5F2EA 0%, #E94B2C 60%, #FBA94C 100%) !important;
  -webkit-background-clip: text !important;
  background-clip: text !important;
  -webkit-text-fill-color: transparent !important;
  color: transparent !important;
}
[data-theme="dark"] .mg-body .mg-topbar__sub { color: var(--bn-ink-muted) !important; }
[data-theme="dark"] .mg-body .mg-topbar__nav a { color: var(--bn-ink-secondary) !important; }
[data-theme="dark"] .mg-body .mg-topbar__nav a:hover { color: var(--bn-ink) !important; }
[data-theme="dark"] .mg-body .mg-topbar__nav a.is-active {
  color: #E94B2C !important;
}

/* Stage — subtle radial ambient glow + correct height */
[data-theme="dark"] .mg-body .mg-stage {
  background:
    radial-gradient(ellipse 900px 700px at 50% 50%, rgba(233, 75, 44, 0.06), transparent 70%),
    radial-gradient(ellipse 600px 400px at 80% 20%, rgba(251, 169, 76, 0.04), transparent 70%),
    #0E0D0B !important;
  /* Ensure stage takes full viewport between topbar (~120px) and composer (~110px) */
  min-height: calc(100vh - 240px) !important;
  height: calc(100vh - 240px);
}

/* Constellation pills — dark glass */
[data-theme="dark"] .mg-body .mg-node--mem,
[data-theme="dark"] .mg-body .mg-node--cat {
  background: rgba(31, 27, 21, 0.85) !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  color: var(--bn-ink) !important;
  box-shadow:
    0 2px 6px rgba(0, 0, 0, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.04) !important;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
[data-theme="dark"] .mg-body .mg-node--mem:hover {
  border-color: rgba(233, 75, 44, 0.5) !important;
  box-shadow:
    0 0 0 1px rgba(233, 75, 44, 0.4),
    0 4px 14px rgba(233, 75, 44, 0.20),
    inset 0 1px 0 rgba(255, 255, 255, 0.06) !important;
}
[data-theme="dark"] .mg-body .mg-node--cat:hover {
  border-color: rgba(251, 169, 76, 0.5) !important;
  box-shadow:
    0 0 0 1px rgba(251, 169, 76, 0.4),
    0 4px 14px rgba(251, 169, 76, 0.20) !important;
}
[data-theme="dark"] .mg-body .mg-node--cat.is-drop-target {
  background: rgba(233, 75, 44, 0.15) !important;
  border-color: #E94B2C !important;
  box-shadow: 0 0 0 2px rgba(233, 75, 44, 0.5), 0 0 30px rgba(233, 75, 44, 0.35) !important;
}

/* Root node — coral glow */
[data-theme="dark"] .mg-body .mg-node--root {
  background:
    radial-gradient(circle at 30% 30%, rgba(251, 169, 76, 0.18), transparent 60%),
    linear-gradient(135deg, #E94B2C 0%, #C5392A 100%) !important;
  border: 1px solid rgba(255, 255, 255, 0.18) !important;
  box-shadow:
    0 0 60px rgba(233, 75, 44, 0.40),
    0 0 20px rgba(233, 75, 44, 0.60),
    inset 0 1px 0 rgba(255, 255, 255, 0.20) !important;
  color: #fff !important;
}

/* Category labels under icon nodes */
[data-theme="dark"] .mg-body .mg-node--cat .mg-node__label {
  color: var(--bn-ink-secondary) !important;
}

/* Add-memory + node */
[data-theme="dark"] .mg-body .mg-add-node {
  background: rgba(233, 75, 44, 0.18) !important;
  border: 1px dashed rgba(233, 75, 44, 0.45) !important;
  color: #E94B2C !important;
}
[data-theme="dark"] .mg-body .mg-add-node:hover {
  background: rgba(233, 75, 44, 0.28) !important;
  border-style: solid !important;
}

/* Edges (SVG lines + travelling dots) — coral tint */
[data-theme="dark"] .mg-body .mg-edges line,
[data-theme="dark"] .mg-body .mg-edges path {
  stroke: rgba(255, 255, 255, 0.08) !important;
}
[data-theme="dark"] .mg-body .mg-edges .mg-edge-pulse {
  fill: rgba(233, 75, 44, 0.6) !important;
}

/* Composer at the bottom — dark glass */
[data-theme="dark"] .mg-body .mg-composer-wrap {
  background: linear-gradient(180deg, transparent 0%, rgba(14, 13, 11, 0.9) 40%, #0E0D0B 100%) !important;
}
[data-theme="dark"] .mg-body .mg-composer,
[data-theme="dark"] .mg-body .bn-composer {
  background: rgba(31, 27, 21, 0.92) !important;
  border-color: rgba(255, 255, 255, 0.08) !important;
  box-shadow:
    0 12px 32px rgba(0, 0, 0, 0.5),
    inset 0 1px 0 rgba(255, 255, 255, 0.04) !important;
  color: var(--bn-ink) !important;
}
[data-theme="dark"] .mg-body .bn-composer__field {
  color: var(--bn-ink) !important;
}
[data-theme="dark"] .mg-body .bn-composer__field::placeholder { color: var(--bn-ink-muted) !important; }
[data-theme="dark"] .mg-body .bn-composer__icon-btn { color: var(--bn-ink-secondary) !important; }
[data-theme="dark"] .mg-body .bn-composer__icon-btn:hover {
  background: rgba(255, 255, 255, 0.05) !important;
  color: var(--bn-ink) !important;
}
[data-theme="dark"] .mg-body .bn-composer__send {
  background: #E94B2C !important;
  color: #fff !important;
}
[data-theme="dark"] .mg-body .bn-composer__send:hover { background: #F46340 !important; }

[data-theme="dark"] .mg-body .mg-composer__hint {
  color: var(--bn-ink-muted) !important;
}
[data-theme="dark"] .mg-body .mg-composer__hint kbd {
  background: rgba(255, 255, 255, 0.06) !important;
  border-color: rgba(255, 255, 255, 0.08) !important;
  color: var(--bn-ink-secondary) !important;
}

/* Pills used for status badge */
[data-theme="dark"] .mg-body .bn-pill {
  background: rgba(31, 27, 21, 0.7) !important;
  border-color: rgba(255, 255, 255, 0.08) !important;
  color: var(--bn-ink-secondary) !important;
}
[data-theme="dark"] .mg-body .bn-pill--accent {
  background: rgba(233, 75, 44, 0.18) !important;
  color: #FBA94C !important;
  border-color: transparent !important;
}

/* Buttons in topbar */
[data-theme="dark"] .mg-body .bn-btn--ghost {
  color: var(--bn-ink-secondary) !important;
}
[data-theme="dark"] .mg-body .bn-btn--ghost:hover {
  background: rgba(255, 255, 255, 0.06) !important;
  color: var(--bn-ink) !important;
}
[data-theme="dark"] .mg-body .bn-btn--icon {
  background: rgba(31, 27, 21, 0.6) !important;
  border-color: rgba(255, 255, 255, 0.08) !important;
  color: var(--bn-ink) !important;
}
[data-theme="dark"] .mg-body .bn-btn--icon:hover {
  background: rgba(255, 255, 255, 0.08) !important;
}

/* Center title overlay */
[data-theme="dark"] .mg-body .mg-center-title h2 {
  background: linear-gradient(135deg, #F5F2EA 0%, #E94B2C 60%, #FBA94C 100%) !important;
  -webkit-background-clip: text !important;
  background-clip: text !important;
  -webkit-text-fill-color: transparent !important;
  color: transparent !important;
}
[data-theme="dark"] .mg-body .mg-center-title p { color: var(--bn-ink-muted) !important; }

/* Sign-in gate banner — premium dark card */
[data-theme="dark"] .mg-body .mg-signin-gate__card {
  background: rgba(31, 27, 21, 0.95) !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  color: var(--bn-ink) !important;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5) !important;
}
[data-theme="dark"] .mg-body .mg-signin-gate__card h2 { color: var(--bn-ink) !important; }
[data-theme="dark"] .mg-body .mg-signin-gate__card p { color: var(--bn-ink-muted) !important; }
[data-theme="dark"] .mg-body .mg-signin-gate__card .bn-btn--primary {
  background: #E94B2C !important;
  color: #fff !important;
  border-color: #E94B2C !important;
}

/* Modal on dark */
[data-theme="dark"] .mg-body .bn-modal {
  background: #1F1B15 !important;
  border: 1px solid rgba(255, 255, 255, 0.10) !important;
  color: var(--bn-ink) !important;
}
[data-theme="dark"] .mg-body .bn-modal__title { color: var(--bn-ink) !important; }
[data-theme="dark"] .mg-body .bn-modal__body { color: var(--bn-ink-secondary) !important; }
[data-theme="dark"] .mg-body .bn-input, [data-theme="dark"] .mg-body .bn-textarea, [data-theme="dark"] .mg-body .bn-select {
  background: rgba(255, 255, 255, 0.04) !important;
  border-color: rgba(255, 255, 255, 0.10) !important;
  color: var(--bn-ink) !important;
}
[data-theme="dark"] .mg-body .bn-input::placeholder { color: var(--bn-ink-muted) !important; }
[data-theme="dark"] .mg-body .bn-input:focus, [data-theme="dark"] .mg-body .bn-textarea:focus, [data-theme="dark"] .mg-body .bn-select:focus {
  border-color: #E94B2C !important;
  box-shadow: 0 0 0 3px rgba(233, 75, 44, 0.18) !important;
}

/* Cat popover */
[data-theme="dark"] .mg-body .mg-cat-popover {
  background: #1F1B15 !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  color: var(--bn-ink) !important;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.5) !important;
}
[data-theme="dark"] .mg-body .mg-cat-popover button {
  color: var(--bn-ink) !important;
}
[data-theme="dark"] .mg-body .mg-cat-popover button:hover {
  background: rgba(255, 255, 255, 0.06) !important;
}

/* Toast on dark */
[data-theme="dark"] .mg-body .bn-toast {
  background: #1F1B15 !important;
  border-color: rgba(255, 255, 255, 0.10) !important;
  color: var(--bn-ink) !important;
}

/* =====================================================================
   CREAM THEME — make edges + pills visible on light bg
   (these rules apply when theme is NOT dark)
   ===================================================================== */
html:not([data-theme="dark"]) .mg-edge {
  stroke: rgba(26, 24, 21, 0.18) !important;
}
html:not([data-theme="dark"]) .mg-edge--cat {
  stroke: rgba(26, 24, 21, 0.28) !important;
}
html:not([data-theme="dark"]) .mg-edge--mem {
  stroke: rgba(26, 24, 21, 0.14) !important;
}
html:not([data-theme="dark"]) .mg-edges line,
html:not([data-theme="dark"]) .mg-edges path {
  stroke: rgba(26, 24, 21, 0.18) !important;
}
html:not([data-theme="dark"]) #edgeGrad stop:nth-child(1),
html:not([data-theme="dark"]) #edgeGrad stop:nth-child(3) {
  stop-color: rgba(26, 24, 21, 0.10) !important;
}
html:not([data-theme="dark"]) #edgeGrad stop:nth-child(2) {
  stop-color: rgba(26, 24, 21, 0.30) !important;
}

/* Cream theme — memory pill on cream bg, dark text + visible border */
html:not([data-theme="dark"]) .mg-body .mg-node--mem {
  background: var(--bn-bg-surface-1) !important;
  border: 1px solid var(--bn-border) !important;
  color: var(--bn-ink) !important;
  box-shadow: 0 1px 2px rgba(26, 24, 21, 0.04) !important;
}
html:not([data-theme="dark"]) .mg-body .mg-node--mem:hover {
  border-color: var(--bn-accent) !important;
  box-shadow: 0 0 0 1px var(--bn-accent), 0 4px 12px rgba(233, 75, 44, 0.12) !important;
}

/* Cream theme — category nodes on cream bg */
html:not([data-theme="dark"]) .mg-body .mg-node--cat {
  background:
    linear-gradient(180deg, rgba(255,255,255,0.6) 0%, rgba(255,255,255,0.3) 100%),
    var(--bn-bg-surface-1) !important;
  border: 1px solid var(--bn-border) !important;
  box-shadow: 0 2px 6px rgba(26, 24, 21, 0.05), inset 0 1px 0 rgba(255,255,255,0.6) !important;
}
html:not([data-theme="dark"]) .mg-body .mg-node--cat:hover {
  border-color: var(--bn-accent) !important;
  box-shadow: 0 0 0 1px var(--bn-accent), 0 6px 18px rgba(233, 75, 44, 0.12) !important;
}
html:not([data-theme="dark"]) .mg-body .mg-node--cat__count {
  border: 2px solid var(--bn-bg-page) !important;
}
html:not([data-theme="dark"]) .mg-body .mg-node--cat .mg-node--cat__label {
  color: var(--bn-ink-secondary) !important;
}
html:not([data-theme="dark"]) .mg-body .mg-node--cat iconify-icon {
  color: var(--bn-accent) !important;
  font-size: 24px !important;
}
[data-theme="dark"] .mg-body .mg-node--cat iconify-icon {
  color: #FBA94C !important;
  font-size: 24px !important;
}

/* Cream theme — root node with coral glow */
html:not([data-theme="dark"]) .mg-body .mg-node--root {
  background:
    radial-gradient(circle at 30% 30%, rgba(251, 169, 76, 0.30), transparent 60%),
    linear-gradient(135deg, var(--bn-accent) 0%, #B83218 100%) !important;
  border: 1px solid rgba(255, 255, 255, 0.4) !important;
  box-shadow:
    0 0 60px rgba(233, 75, 44, 0.30),
    0 0 20px rgba(233, 75, 44, 0.50),
    inset 0 1px 0 rgba(255, 255, 255, 0.35) !important;
  color: #fff !important;
}
html:not([data-theme="dark"]) .mg-body .mg-node--root::before {
  content: '';
  position: absolute;
  inset: -12px;
  border-radius: 50%;
  background: radial-gradient(circle at center, rgba(233, 75, 44, 0.30), transparent 60%);
  filter: blur(8px);
  z-index: -1;
  animation: mg-pulse-aura 3s ease-in-out infinite;
  pointer-events: none;
}

/* Cream theme — stage warm radial */
html:not([data-theme="dark"]) .mg-body .mg-stage {
  background:
    radial-gradient(ellipse 900px 700px at 50% 50%, rgba(233, 75, 44, 0.04), transparent 70%),
    radial-gradient(ellipse 600px 400px at 80% 20%, rgba(251, 169, 76, 0.03), transparent 70%),
    var(--bn-bg-page) !important;
}

/* Cream theme — composer + send */
html:not([data-theme="dark"]) .mg-body .bn-composer {
  background: var(--bn-bg-surface-1) !important;
  border-color: var(--bn-border) !important;
  box-shadow: 0 12px 32px rgba(26, 24, 21, 0.08), var(--bn-inset-highlight) !important;
}
html:not([data-theme="dark"]) .mg-body .bn-composer__send {
  background: var(--bn-accent) !important;
}
html:not([data-theme="dark"]) .mg-body .bn-composer__send:hover {
  background: var(--bn-accent-hover) !important;
}
html:not([data-theme="dark"]) .mg-body .bn-composer__field {
  color: var(--bn-ink) !important;
}

/* Cream theme — topbar + status pill */
html:not([data-theme="dark"]) .mg-body .mg-topbar {
  background: rgba(248, 246, 242, 0.85) !important;
  border-bottom: 1px solid var(--bn-border-soft) !important;
}
html:not([data-theme="dark"]) .mg-body .mg-status .bn-pill {
  background: var(--bn-accent-soft) !important;
  color: var(--bn-accent) !important;
  border-color: rgba(233, 75, 44, 0.25) !important;
}

/* Cream theme — composer wrap gradient fade */
html:not([data-theme="dark"]) .mg-body .mg-composer-wrap {
  background: linear-gradient(180deg, transparent 0%, rgba(248, 246, 242, 0.9) 40%, var(--bn-bg-page) 100%) !important;
}

/* Cream theme — add memory + button */
html:not([data-theme="dark"]) .mg-body .mg-add-node {
  background: var(--bn-accent-soft) !important;
  border: 1px dashed rgba(233, 75, 44, 0.45) !important;
  color: var(--bn-accent) !important;
}
html:not([data-theme="dark"]) .mg-body .mg-add-node:hover {
  background: var(--bn-accent) !important;
  color: #fff !important;
  border-style: solid !important;
}

/* Cream theme — sign-in card */
html:not([data-theme="dark"]) .mg-body .mg-signin-gate__card {
  background: rgba(248, 246, 242, 0.98) !important;
  border: 1px solid var(--bn-border) !important;
  box-shadow: 0 24px 60px rgba(26, 24, 21, 0.12) !important;
}

/* Cream theme — modal */
html:not([data-theme="dark"]) .mg-body .bn-modal {
  background: var(--bn-bg-page) !important;
  border: 1px solid var(--bn-border) !important;
  color: var(--bn-ink) !important;
}
html:not([data-theme="dark"]) .mg-body .bn-input,
html:not([data-theme="dark"]) .mg-body .bn-textarea {
  background: var(--bn-bg-surface-1) !important;
  border-color: var(--bn-border) !important;
  color: var(--bn-ink) !important;
}

/* =====================================================================
   CURSOR SPOTLIGHT (Higgsfield-style ambient glow follows mouse)
   ===================================================================== */
[data-theme="dark"] .mg-body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(
      circle 600px at var(--mouse-x, 50%) var(--mouse-y, 50%),
      rgba(233, 75, 44, 0.06),
      transparent 60%
    );
  z-index: 0;
  transition: background 200ms ease;
}
[data-theme="dark"] .mg-body .mg-stage { position: relative; z-index: 1; }
[data-theme="dark"] .mg-body .mg-topbar { position: relative; z-index: 2; }
[data-theme="dark"] .mg-body .mg-composer-wrap { position: relative; z-index: 2; }

/* =====================================================================
   CONSTELLATION POLISH — refined motion + glow
   ===================================================================== */

/* Smooth spring transitions on every interactive element */
[data-theme="dark"] .mg-body .mg-node {
  transition:
    transform 380ms cubic-bezier(0.16, 1, 0.3, 1),
    box-shadow 260ms cubic-bezier(0.16, 1, 0.3, 1),
    border-color 200ms ease,
    background 200ms ease,
    opacity 200ms ease !important;
  will-change: transform;
}

/* Memory pill — depth and hover lift */
[data-theme="dark"] .mg-body .mg-node--mem {
  font-weight: 500 !important;
  font-size: 13px !important;
  padding: 7px 13px !important;
  letter-spacing: -0.005em !important;
  border-radius: 10px !important;
}
[data-theme="dark"] .mg-body .mg-node--mem:hover {
  transform: translate(-50%, -50%) translateY(-2px) !important;
}

/* Category nodes — circular icon + label below */
[data-theme="dark"] .mg-body .mg-node--cat {
  width: 56px !important;
  height: 56px !important;
  border-radius: 14px !important;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.04) 0%, rgba(255,255,255,0.01) 100%),
    rgba(31, 27, 21, 0.85) !important;
  /* keep position: absolute from base .mg-node */
  display: grid !important;
  place-items: center !important;
  padding: 0 !important;
  font-size: 22px !important;
  overflow: visible !important;
}
/* Hide internal label span — we render label as ::after below */
[data-theme="dark"] .mg-body .mg-node--cat .mg-node--cat__label {
  position: absolute !important;
  top: calc(100% + 6px) !important;
  left: 50% !important;
  transform: translateX(-50%) !important;
  font-size: 11px !important;
  font-weight: 500 !important;
  color: var(--bn-ink-secondary) !important;
  white-space: nowrap !important;
  letter-spacing: 0.02em !important;
  text-transform: uppercase !important;
  opacity: 0.85 !important;
  display: inline !important;
  background: transparent !important;
  border: none !important;
  padding: 0 !important;
  margin: 0 !important;
  pointer-events: none;
}
/* Count badge — coral pill top-right */
[data-theme="dark"] .mg-body .mg-node--cat .mg-node--cat__count {
  position: absolute !important;
  top: -6px !important;
  right: -6px !important;
  min-width: 18px;
  height: 18px;
  padding: 0 5px !important;
  display: grid;
  place-items: center;
  background: var(--bn-accent, #E94B2C) !important;
  color: #fff !important;
  border-radius: 9px !important;
  font-size: 10px !important;
  font-weight: 600 !important;
  border: 2px solid #0E0D0B !important;
  letter-spacing: 0 !important;
}
[data-theme="dark"] .mg-body .mg-node--cat:hover {
  transform: translate(-50%, -50%) scale(1.08) !important;
}

/* Root node — pulsing aura + inner gradient */
[data-theme="dark"] .mg-body .mg-node--root {
  width: 96px !important;
  height: 96px !important;
  font-size: 32px !important;
  font-weight: 600 !important;
  font-family: var(--bn-font-display) !important;
  letter-spacing: -0.04em !important;
  position: relative;
  isolation: isolate;
}
[data-theme="dark"] .mg-body .mg-node--root::before {
  content: '';
  position: absolute;
  inset: -12px;
  border-radius: 50%;
  background:
    radial-gradient(circle at center, rgba(233, 75, 44, 0.35), transparent 60%);
  filter: blur(8px);
  z-index: -1;
  animation: mg-pulse-aura 3s ease-in-out infinite;
  pointer-events: none;
}
@keyframes mg-pulse-aura {
  0%, 100% { transform: scale(1); opacity: 0.6; }
  50%      { transform: scale(1.15); opacity: 1; }
}

/* Drop target — coral glow ring */
[data-theme="dark"] .mg-body .mg-node--cat.is-drop-target {
  animation: mg-drop-pulse 1s ease-in-out infinite;
}
@keyframes mg-drop-pulse {
  0%, 100% { box-shadow: 0 0 0 2px rgba(233, 75, 44, 0.5), 0 0 30px rgba(233, 75, 44, 0.35); }
  50%      { box-shadow: 0 0 0 3px rgba(233, 75, 44, 0.7), 0 0 50px rgba(233, 75, 44, 0.55); }
}

/* Dragging state — disable transition, scale up */
[data-theme="dark"] .mg-body .mg-node.is-dragging {
  transition: none !important;
  z-index: 50;
  cursor: grabbing;
  filter: drop-shadow(0 8px 20px rgba(0,0,0,0.6));
}
[data-theme="dark"] .mg-body .mg-node.is-dragging .mg-node__chip,
[data-theme="dark"] .mg-body .mg-node--mem.is-dragging {
  border-color: rgba(233, 75, 44, 0.5) !important;
  box-shadow: 0 0 0 1px rgba(233, 75, 44, 0.4), 0 12px 32px rgba(0,0,0,0.5) !important;
}

/* Add memory pill — coral pulse on hover */
[data-theme="dark"] .mg-body .mg-add-node {
  width: 56px !important;
  height: 56px !important;
  font-size: 20px !important;
  border-radius: 14px !important;
}
[data-theme="dark"] .mg-body .mg-add-node::after {
  content: 'Add memory';
  position: absolute;
  top: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  font-size: 11px;
  font-weight: 500;
  color: var(--bn-ink-secondary);
  white-space: nowrap;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  opacity: 0.85;
}
[data-theme="dark"] .mg-body .mg-add-node:hover {
  transform: translate(-50%, -50%) scale(1.08) !important;
  border-style: solid !important;
}

/* Composer hint — spaced + premium */
[data-theme="dark"] .mg-body .mg-composer__hint {
  text-align: center;
  margin-top: 12px;
  font-size: 11px;
  letter-spacing: 0.01em;
}

/* Status pill at top — glow on dot */
[data-theme="dark"] .mg-body .bn-pill__dot--pulse {
  background: #E94B2C !important;
  box-shadow: 0 0 8px rgba(233, 75, 44, 0.8);
}

/* =====================================================================
   MOBILE — composer becomes sticky bottom sheet
   ===================================================================== */
@media (max-width: 720px) {
  /* Prevent any horizontal overflow */
  html, body { overflow-x: hidden !important; }
  .mg-body, .mg-stage { max-width: 100vw !important; overflow-x: hidden !important; }

  /* Compact mobile constellation */
  [data-theme="dark"] .mg-body .mg-node--cat .mg-node--cat__label { display: none !important; }
  [data-theme="dark"] .mg-body .mg-node--cat .mg-node--cat__count {
    font-size: 9px !important;
    min-width: 14px !important;
    height: 14px !important;
    border-radius: 7px !important;
    top: -4px !important;
    right: -4px !important;
  }
  [data-theme="dark"] .mg-body .mg-node--mem {
    max-width: 110px;
    font-size: 11px !important;
    padding: 5px 9px !important;
  }
  [data-theme="dark"] .mg-body .mg-stage {
    /* leave space for sticky composer at bottom */
    padding-bottom: 100px;
  }
  /* Status pill at top — smaller */
  [data-theme="dark"] .mg-body .mg-status {
    top: 56px !important;
  }
  [data-theme="dark"] .mg-body .mg-status .bn-pill {
    font-size: 10px !important;
    padding: 4px 8px !important;
  }

  [data-theme="dark"] .mg-body .mg-topbar {
    flex-direction: column;
    height: auto;
    gap: 8px;
    padding: 12px;
  }
  [data-theme="dark"] .mg-body .mg-topbar__nav { order: 3; flex-wrap: wrap; justify-content: center; }
  [data-theme="dark"] .mg-body .mg-topbar__right {
    order: 2;
    flex-wrap: wrap;
    justify-content: center;
  }
  [data-theme="dark"] .mg-body .mg-topbar__right .bn-btn span:not(.bn-pill__dot) { display: none; }
  [data-theme="dark"] .mg-body .mg-topbar__right .bn-btn kbd { display: none; }
  [data-theme="dark"] .mg-body .mg-node--root { width: 72px !important; height: 72px !important; font-size: 22px !important; }
  [data-theme="dark"] .mg-body .mg-node--cat { width: 44px !important; height: 44px !important; }
  [data-theme="dark"] .mg-body .mg-add-node { width: 44px !important; height: 44px !important; }
  [data-theme="dark"] .mg-body .mg-composer-wrap {
    padding: 12px;
  }
  [data-theme="dark"] .mg-body .mg-composer__hint { display: none; }
  [data-theme="dark"] .mg-body .mg-signin-gate {
    bottom: 100px !important;
    left: 12px !important;
    right: 12px !important;
  }
  [data-theme="dark"] .mg-body .mg-signin-gate__card {
    flex-direction: column !important;
    text-align: center;
    gap: 8px !important;
  }
}

