:root {
  --ngmm-deco-font: "Cinzel Decorative", ui-serif, serif;
  --ngmm-serif-font: "Cinzel", ui-serif, Georgia, serif;
  --ngmm-mono-font: "Space Mono", ui-monospace, Menlo, monospace;
  --ngmm-ui-font: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --ngmm-bg-0: #03050f;
  --ngmm-bg-1: #080a16;
  --ngmm-bg-2: #03050f;
  --ngmm-ink: rgba(245, 248, 255, 0.94);
  --ngmm-muted: rgba(245, 248, 255, 0.68);
  --ngmm-soft: rgba(245, 248, 255, 0.48);
  --ngmm-border: rgba(255, 255, 255, 0.14);
  --ngmm-border-strong: rgba(45, 224, 197, 0.38);
  --ngmm-violet: rgba(124, 131, 255, 1);
  --ngmm-cyan: rgba(45, 224, 197, 1);
  --ngmm-orchid: rgba(176, 114, 255, 1);
  --ngmm-danger: rgba(255, 100, 130, 1);
}

.ngmm-shell,
.ngmm-shell *,
.mm-root,
.mm-root * {
  box-sizing: border-box;
}

.ngmm-shell {
  width: 100%;
}

.ngmm-searchbar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.ngmm-search {
  flex: 1;
  min-width: 0;
  border-radius: 999px;
  border: 1px solid var(--ngmm-border);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.04));
  color: var(--ngmm-ink);
  padding: 10px 14px;
  outline: none;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.ngmm-search::placeholder {
  color: rgba(245, 248, 255, 0.35);
}

.ngmm-search:focus {
  border-color: rgba(124, 131, 255, 0.38);
  box-shadow: 0 0 0 3px rgba(124, 131, 255, 0.14);
}

.ngmm-chip {
  min-width: 40px;
  text-align: center;
  border-radius: 999px;
  border: 1px solid var(--ngmm-border);
  background: rgba(255, 255, 255, 0.05);
  color: var(--ngmm-ink);
  padding: 9px 12px;
  font: 700 11px var(--ngmm-mono-font);
  letter-spacing: 0.04em;
}

.mm-root {
  --mm-height: 80vh;
  --mm-min-height: 70vh;
  position: relative;
  width: 100%;
  min-height: var(--mm-min-height);
  height: var(--mm-height);
  background:
    linear-gradient(160deg, rgba(255, 255, 255, 0.11), rgba(255, 255, 255, 0.035)),
    radial-gradient(circle at 50% 44%, rgba(124, 131, 255, 0.18), transparent 52%),
    radial-gradient(ellipse at 12% 8%, rgba(124, 131, 255, 0.2), transparent 42%),
    radial-gradient(ellipse at 88% 10%, rgba(45, 224, 197, 0.15), transparent 42%),
    linear-gradient(180deg, rgba(3, 5, 15, 0.96), rgba(8, 10, 22, 0.98));
  border: 1px solid var(--ngmm-border);
  border-radius: 22px;
  overflow: hidden;
  font-family: var(--ngmm-ui-font);
  color: var(--ngmm-ink);
  box-shadow: 0 30px 100px rgba(0, 0, 0, 0.38), inset 0 0 0 1px rgba(255, 255, 255, 0.05);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.mm-stage {
  position: absolute;
  inset: 0;
  z-index: 1;
}

.mm-svg {
  width: 100%;
  height: 100%;
  display: block;
  user-select: none;
  -webkit-user-select: none;
  touch-action: pan-y;
}

.mm-root.mm-interacting .mm-svg {
  touch-action: none;
}

.mm-toolbar {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 8;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
  max-width: calc(100% - 24px);
}

.mm-brand,
.mm-btn,
.mm-mini {
  border-radius: 999px;
  border: 1px solid var(--ngmm-border);
  color: var(--ngmm-ink);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.mm-brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  text-decoration: none;
  background: rgba(255, 255, 255, 0.05);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.38), 0 0 22px rgba(124, 131, 255, 0.10);
  font: 700 11px var(--ngmm-mono-font);
  letter-spacing: 0.10em;
  text-transform: uppercase;
}

.mm-btn,
.mm-mini {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.04));
  cursor: pointer;
  transition: transform 0.14s ease, box-shadow 0.14s ease, border-color 0.14s ease;
}

.mm-btn {
  font: 700 11px var(--ngmm-mono-font);
  padding: 8px 14px;
  box-shadow: 0 0 20px rgba(124, 131, 255, 0.12), 0 8px 28px rgba(0, 0, 0, 0.28);
}

.mm-mini {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  font: 700 11px var(--ngmm-mono-font);
  padding: 6px 12px;
}

.mm-btn:hover,
.mm-mini:hover,
.mm-brand:hover {
  border-color: rgba(124, 131, 255, 0.30);
  box-shadow: 0 0 28px rgba(124, 131, 255, 0.20), 0 10px 30px rgba(0, 0, 0, 0.32);
  transform: translateY(-1px);
}

.mm-btn.mm-danger {
  border-color: rgba(255, 100, 130, 0.26);
}

.mm-tip,
.mm-toast {
  position: absolute;
  border-radius: 999px;
  border: 1px solid var(--ngmm-border);
  background: rgba(10, 12, 28, 0.78);
  color: var(--ngmm-ink);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.mm-tip {
  left: 12px;
  bottom: 12px;
  z-index: 6;
  padding: 7px 14px;
  font: 400 11px var(--ngmm-mono-font);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.mm-tip.show,
.mm-toast.show {
  opacity: 1;
  transform: translateY(0);
}

.mm-toast {
  right: 12px;
  bottom: 12px;
  z-index: 30;
  padding: 8px 14px;
  font: 700 11px var(--ngmm-mono-font);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.18s ease, transform 0.18s ease;
  pointer-events: none;
}

.mm-pop,
.mm-editor {
  background: rgba(10, 12, 28, 0.95);
  border: 1px solid var(--ngmm-border);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

.mm-pop {
  position: absolute;
  z-index: 20;
  display: none;
  width: min(360px, calc(100% - 24px));
  padding: 14px 16px;
  border-radius: 18px;
  box-shadow: 0 0 40px rgba(124, 131, 255, 0.14), 0 20px 70px rgba(0, 0, 0, 0.60);
}

.mm-pop.show {
  display: block;
}

.mm-pop-title {
  font: 700 13px var(--ngmm-mono-font);
  color: rgba(245, 248, 255, 0.95);
}

.mm-pop-meta {
  margin-top: 4px;
  margin-bottom: 8px;
  font: 700 10px var(--ngmm-mono-font);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(124, 131, 255, 0.90);
}

.mm-pop-desc {
  font: 400 12px var(--ngmm-mono-font);
  color: rgba(245, 248, 255, 0.65);
  line-height: 1.5;
  white-space: pre-wrap;
}

.mm-pop-actions,
.mm-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.mm-pop-actions {
  margin-top: 12px;
}

.mm-editor {
  position: absolute;
  top: 0;
  right: 0;
  z-index: 10;
  width: min(420px, 92vw);
  height: 100%;
  border-left: 1px solid var(--ngmm-border);
  transform: translateX(102%);
  transition: transform 0.18s ease;
}

.mm-editor.open {
  transform: translateX(0);
}

.mm-editor-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.mm-editor-title,
.mm-section-title {
  font: 700 11px var(--ngmm-mono-font);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(124, 131, 255, 0.88);
}

.mm-close {
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: rgba(245, 248, 255, 0.62);
  padding: 6px 10px;
  cursor: pointer;
}

.mm-editor-body {
  height: calc(100% - 54px);
  overflow: auto;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.mm-section {
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  padding: 14px;
  background: rgba(8, 10, 22, 0.58);
}

.mm-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.mm-grid label {
  display: flex;
  flex-direction: column;
  gap: 5px;
  color: rgba(245, 248, 255, 0.55);
  font: 700 11px var(--ngmm-mono-font);
}

.mm-grid input[type="text"],
.mm-grid input[type="search"],
.mm-grid select,
.mm-grid textarea,
.mm-json {
  width: 100%;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.10);
  background: rgba(8, 10, 22, 0.60);
  color: var(--ngmm-ink);
  padding: 10px;
  outline: none;
  box-sizing: border-box;
}

.mm-grid input[type="color"] {
  width: 100%;
  min-height: 38px;
  padding: 0;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.10);
  background: transparent;
}

.mm-grid textarea,
.mm-json {
  resize: vertical;
}

.mm-grid input:focus,
.mm-grid select:focus,
.mm-grid textarea:focus,
.mm-json:focus {
  border-color: rgba(124, 131, 255, 0.38);
  box-shadow: 0 0 0 3px rgba(124, 131, 255, 0.14);
}

.mm-wide {
  grid-column: 1 / -1;
}

.mm-hint {
  margin-top: 10px;
  color: rgba(245, 248, 255, 0.42);
  font: 400 12px var(--ngmm-mono-font);
  line-height: 1.5;
}

.mm-relationship-list {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.mm-relationship,
.mm-empty {
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.10);
  background: rgba(255, 255, 255, 0.04);
  color: rgba(245, 248, 255, 0.66);
  font: 700 11px var(--ngmm-mono-font);
}

.mm-relationship {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px;
}

.mm-relationship span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.mm-empty {
  padding: 10px;
}

.screen-reader-text {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

@media (max-width: 720px) {
  .mm-root {
    height: 72vh;
  }

  .mm-toolbar {
    top: 10px;
    left: 10px;
  }

  .mm-grid {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  .mm-brand,
  .mm-btn,
  .mm-mini,
  .mm-editor,
  .mm-tip,
  .mm-toast {
    transition: none;
  }
}
