.card.mkg-card { padding: 0; overflow: hidden; background: var(--card); border: 1px solid var(--border); border-radius: 16px; }
.mkg-chrome { padding: 12px 16px 8px; border-bottom: 1px solid var(--border); min-width: 0; }
.mkg-title {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px; letter-spacing: .12em; text-transform: uppercase;
  color: var(--accent); font-weight: 700;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%;
}
.mkg-sub { font-size: 12px; color: var(--muted); margin-top: 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mkg-body { display: flex; gap: 10px; align-items: stretch; padding: 10px; flex: 1; min-height: 0; }
.mkg-stage {
  position: relative; flex: 1; min-width: 0; min-height: 0;
  overflow: hidden; border: 1px solid var(--border); border-radius: 10px; background: #06101f;
}
.mkg-svg { width: 100%; height: 100%; display: block; overflow: hidden; }
.mkg-grid {
  pointer-events: none; position: absolute; inset: 0;
  background-image: linear-gradient(to right, #16324a 1px, transparent 1px), linear-gradient(to bottom, #16324a 1px, transparent 1px);
  background-size: 44px 44px; opacity: .4; animation: mkg-drift 26s linear infinite;
}
.mkg-fs-btn, .mkg-back {
  position: absolute; z-index: 3; top: 10px;
  border: 1px solid var(--border); background: rgba(5,11,24,.82); color: var(--muted);
  font-family: ui-monospace, monospace; font-size: 10.5px; border-radius: 6px; padding: 5px 8px; cursor: pointer;
}
.mkg-fs-btn { right: 10px; }
.mkg-back { left: 10px; }
.mkg-fs-btn:hover, .mkg-back:hover { color: var(--accent); }
.mkg-focus-name {
  pointer-events: none; position: absolute; left: 50%; top: 8px; transform: translateX(-50%); z-index: 2;
  max-width: calc(100% - 168px); padding: 0 8px;
  font-size: 16px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  text-shadow: 0 1px 8px rgba(0,0,0,.75); text-align: center;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.mkg-tip {
  position: fixed; z-index: 50; display: none;
  min-width: 228px; max-width: 300px;
  padding: 12px 14px 10px;
  background: #0a1628;
  border: 1px solid rgba(34,211,238,.38);
  border-radius: 16px;
  box-shadow: 0 16px 40px rgba(0,0,0,.55), 0 0 0 1px rgba(34,211,238,.08);
  pointer-events: none; color: var(--text);
}
.mkg-tip.on { display: block; }
.mkg-tip-k { font-family: ui-monospace, monospace; font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); font-weight: 700; margin: 0 0 2px; }
.mkg-tip-n { font-size: 13px; color: var(--text); margin: 0 0 8px; }
.mkg-tip-row { display: flex; justify-content: space-between; gap: 12px; font-size: 12px; padding: 4px 0; border-top: 1px solid rgba(34,211,238,.1); }
.mkg-tip-row span:first-child { color: var(--muted); }
.mkg-tip-row span:last-child { font-family: ui-monospace, monospace; font-size: 12px; text-align: right; }
.mkg-tip-hint { margin: 8px 0 0; font-size: 11px; color: var(--muted); }
.mkg-wheel { display: none; }
.mkg-dir { display: none; }
.mkg-orbit { transform-origin: 50% 50%; transform-box: view-box; animation: mkg-spin 150s linear infinite; }
.mkg-synapse { stroke-dasharray: 0.14 0.86; animation: mkg-syn 5s linear infinite; animation-delay: var(--mkg-syn-delay, 0s); opacity: .55; }
.mkg-synapse-sm { stroke-dasharray: 0.07 0.93; animation: mkg-syn 4s linear infinite; animation-delay: var(--mkg-syn-delay, 0s); opacity: .38; }
.mkg-grow { stroke-dasharray: 1; stroke-dashoffset: 1; animation: mkg-grow 1.1s ease forwards; }
.mkg-dash { stroke-dasharray: 1.5 7; animation: mkg-dash 1s linear infinite; }
.mkg-glow { opacity: 0; animation: mkg-glow-in .9s ease forwards; }
.mkg-core-glow { opacity: .06; animation: mkg-glow-breathe 7s ease-in-out infinite alternate; }
.mkg-mem-l0 { animation: mkg-note-drift 19s ease-in-out infinite alternate, mkg-breathe 6.5s ease-in-out infinite alternate; }
.mkg-mem-l1 { animation: mkg-note-drift 24s ease-in-out -8s infinite alternate, mkg-breathe 8.5s ease-in-out -3s infinite alternate; }
.mkg-mem-l2 { animation: mkg-note-drift 29s ease-in-out -15s infinite alternate, mkg-breathe 11s ease-in-out -6s infinite alternate; }
.mkg-core:hover .mkg-mem-stir { animation-play-state: running; }
.mkg-node.mkg-dim, .mkg-hex.mkg-dim, .mkg-core.mkg-dim { opacity: .1; }
.mkg-node.mkg-branch circle:first-child { filter: brightness(1.22); }
.mkg-edge.mkg-edge-hot, [data-mkg-edge].mkg-edge-hot { opacity: .9 !important; stroke-width: 1.85; }
.mkg-synapse.mkg-edge-hot, .mkg-synapse-sm.mkg-edge-hot { opacity: .95 !important; }
.mkg-edge.mkg-edge-off, [data-mkg-edge].mkg-edge-off { opacity: .04 !important; }
.mkg-tick-lab { opacity: 0; }
.mkg-tick-lab.on, .mkg-ticker:hover .mkg-tick-lab, .mkg-ticker.mkg-hot .mkg-tick-lab { opacity: 1; }
@keyframes mkg-drift { to { background-position: 44px 44px; } }
@keyframes mkg-spin { to { transform: rotate(360deg); } }
@keyframes mkg-syn { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
@keyframes mkg-grow { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
@keyframes mkg-dash { to { stroke-dashoffset: -8.5; } }
@keyframes mkg-glow-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes mkg-glow-breathe { from { opacity: .036; } to { opacity: .108; } }
@keyframes mkg-note-drift { from { transform: translate(0,0); } to { transform: translate(1.1px,-0.8px); } }
@keyframes mkg-breathe { from { opacity: .62; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
  .mkg-grid, .mkg-orbit, .mkg-synapse, .mkg-synapse-sm, .mkg-grow, .mkg-dash, .mkg-glow, .mkg-core-glow, .mkg-mem-l0, .mkg-mem-l1, .mkg-mem-l2 { animation: none; }
  .mkg-grow { stroke-dashoffset: 0; }
  .mkg-glow { opacity: 1; }
}
