body {
  background-color: var(--bg-color);
  color: var(--text-color);
  font-size: 14px;
  font-family: "Helvetica Neue", Helvetica;
  margin: 0;
  padding: 0 12px 40px;
}

#body {
  margin: 0 auto;
  position: relative;
  max-width: 1280px;
}

#primary-nav {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin: 20px auto 10px;
  max-width: 720px;
  align-items: center;
}

.nav-links {
  display: flex;
  gap: 12px;
  flex: 1;
}

.nav-link {
  flex: 1;
  text-align: center;
  padding: 10px 12px;
  border: 1px solid var(--panel-border);
  border-radius: 6px;
  text-decoration: none;
  color: var(--text-color);
  font-weight: 600;
  background: var(--panel-bg);
}

.nav-link.active {
  background: var(--link-color);
  color: #fff;
  border-color: var(--link-color);
}

.theme-toggle {
  border: 1px solid var(--panel-border);
  background: var(--panel-bg);
  color: var(--text-color);
  border-radius: 6px;
  padding: 8px 10px;
  cursor: pointer;
}

#header {
  font-size: 32px;
  font-weight: bold;
  text-align: center;
}

#explorer-pane {
  margin: 10px auto 12px;
  width: 100%;
}

.explorer-hint {
  font-size: 13px;
  color: var(--muted-text);
  margin-bottom: 8px;
}

.explorer-shell {
  border: 1px solid var(--panel-border);
  border-radius: 8px;
  height: 520px;
  overflow: auto;
  background: var(--panel-bg);
  padding: 12px;
}

#resource-panel {
  margin: 10px auto 16px;
  max-width: 720px;
  border: 1px solid var(--panel-border);
  border-radius: 8px;
  padding: 16px 18px;
  background: var(--panel-bg);
}

#resource-panel label {
  display: block;
  font-weight: 600;
  margin-bottom: 4px;
}

#resource-panel input {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--panel-border);
  border-radius: 6px;
  font-size: 14px;
  background: var(--bg-color);
  color: var(--text-color);
}

#add-resource {
  margin-top: 12px;
  padding: 10px 14px;
  background: var(--link-color);
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  cursor: pointer;
}

#add-resource:disabled {
  background: #94a3b8;
  cursor: not-allowed;
}

#json-preview {
  margin: 10px auto 24px;
  max-width: 960px;
}

.json-preview__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.preview-actions button {
  margin-left: 6px;
  padding: 6px 10px;
  font-size: 13px;
  border: 1px solid var(--panel-border);
  background: var(--panel-bg);
  color: var(--text-color);
  border-radius: 4px;
  cursor: pointer;
}

#json-output {
  width: 100%;
  min-height: 260px;
  font-family: "Courier New", monospace;
  font-size: 13px;
  border: 1px solid var(--panel-border);
  border-radius: 6px;
  padding: 12px;
  background: #0f172a;
  color: #e2e8f0;
  box-sizing: border-box;
}

.resource-target {
  font-size: 13px;
  margin-bottom: 10px;
  color: var(--muted-text);
}

.resource-fields {
  margin-top: 8px;
}

path.link {
  fill: none;
  stroke: var(--link-stroke);
  stroke-width: 1px;
}

@media (max-width: 768px) {
  body {
    padding: 0 6px 20px;
  }

  #primary-nav {
    flex-direction: column;
  }

  .nav-links {
    width: 100%;
  }

  .explorer-shell {
    height: 420px;
  }
}
