.settings-toolbar {
  position: sticky;
  top: 0;
  z-index: 15;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  margin-bottom: 16px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(13, 18, 28, .92);
  backdrop-filter: blur(18px);
}

.settings-toolbar b,
.settings-toolbar span,
.collection-item-head b,
.collection-item-head small {
  display: block;
}

.settings-toolbar span,
.section-heading p {
  margin: 3px 0 0;
  color: var(--muted);
}

.settings-toolbar select {
  width: auto;
  min-width: 150px;
}

.form-section {
  overflow: visible;
}

.section-heading {
  margin: -20px -20px 18px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(90deg, rgba(var(--primary-rgb), .08), transparent);
  border-radius: 16px 16px 0 0;
}

.section-heading span {
  color: var(--blue);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.section-heading h2 {
  margin: 3px 0 0;
  font-size: 19px;
}

.setting-field {
  padding: 14px 0;
  border-bottom: 1px solid rgba(37, 45, 61, .65);
}

.setting-field:last-child {
  border-bottom: 0;
}

.entity-picker {
  position: relative;
}

.picker-trigger {
  width: 100%;
  display: grid;
  grid-template-columns: 28px 1fr auto;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--line);
  background: #090d15;
  text-align: left;
}

.picker-trigger:hover,
.picker-trigger:focus {
  border-color: var(--blue);
}

.picker-kind {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: var(--panel2);
  color: var(--cyan);
}

.picker-popover {
  position: absolute;
  z-index: 30;
  top: calc(100% + 7px);
  left: 0;
  right: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: #0d121c;
  box-shadow: var(--shadow);
}

.picker-search {
  margin-bottom: 8px;
}

.picker-options {
  max-height: 290px;
  overflow: auto;
  display: grid;
  gap: 4px;
}

.entity-option {
  display: grid;
  grid-template-columns: 34px 1fr 20px;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px;
  background: transparent;
  text-align: left;
}

.entity-option:hover,
.entity-option.selected {
  background: var(--panel2);
}

.entity-option img,
.entity-glyph {
  width: 32px;
  height: 32px;
  border-radius: 9px;
}

.entity-glyph {
  display: grid;
  place-items: center;
  background: #202a3c;
  color: var(--cyan);
}

.entity-option b,
.entity-option small {
  display: block;
}

.entity-option small {
  color: var(--muted);
  font-weight: 400;
}

.entity-option i {
  color: var(--green);
  font-style: normal;
}

.collection-editor {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: #0a0e16;
}

.collection-toolbar,
.collection-item-head,
.collection-row,
.form-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.collection-toolbar,
.collection-item-head {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  background: var(--panel2);
}

.collection-toolbar span,
.collection-row small,
.collection-item-head small {
  color: var(--muted);
}

.collection-list {
  padding: 7px;
}

.collection-row {
  padding: 10px;
  border-radius: 9px;
}

.collection-row:hover {
  background: rgba(255, 255, 255, .025);
}

.collection-row b,
.collection-row small {
  display: block;
}

.empty-state {
  padding: 28px;
  color: var(--muted);
  text-align: center;
}

.collection-item-form {
  padding: 14px;
}

.form-actions {
  justify-content: flex-end;
  margin-top: 16px;
}

.sticky-save {
  position: sticky;
  bottom: 16px;
  z-index: 12;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 15px;
  border: 1px solid rgba(var(--primary-rgb), .45);
  border-radius: 13px;
  background: rgba(17, 25, 40, .94);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.sticky-save span {
  color: var(--muted);
}

pre {
  max-width: 100%;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
}

.data-view-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.data-view-heading h2,
.data-view-heading p {
  margin: 0;
}

.data-view-heading p {
  margin-top: 3px;
  color: var(--muted);
}

.readonly-badge,
.record-status {
  padding: 5px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
  text-transform: uppercase;
}

.data-records {
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  align-items: start;
}

.data-record {
  padding: 0;
  overflow: hidden;
}

.data-record summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px;
  cursor: pointer;
  list-style: none;
}

.data-record summary::-webkit-details-marker {
  display: none;
}

.data-record summary:hover {
  background: rgba(255, 255, 255, .025);
}

.data-record summary b,
.data-record summary small {
  display: block;
}

.data-record summary small {
  color: var(--muted);
}

.data-record pre {
  max-height: 460px;
  margin: 0;
  padding: 16px;
  border-top: 1px solid var(--line);
  background: #090d15;
}

@media (max-width: 650px) {
  .settings-toolbar,
  .sticky-save,
  .collection-row {
    align-items: stretch;
    flex-direction: column;
  }

  .settings-toolbar select {
    width: 100%;
  }
}

.service-status { display:flex; align-items:center; justify-content:space-between; gap:20px; margin:20px 0 28px; border-color:rgba(var(--yellow-rgb),.28); }
.service-status.online { border-color:rgba(var(--green-rgb),.22); }
.service-status > div { display:flex; align-items:center; gap:13px; }
.service-status h2 { margin:0 0 4px; font-size:17px; }
.service-status p { margin:0; color:var(--muted); }
.service-dot { width:11px; height:11px; flex:none; border-radius:50%; background:var(--yellow); box-shadow:0 0 16px rgba(var(--yellow-rgb),.55); }
.service-status.online .service-dot { background:var(--green); box-shadow:0 0 16px rgba(var(--green-rgb),.45); }
.service-switch { display:flex; align-items:center; gap:10px; font-weight:650; white-space:nowrap; }
.service-dialog { width:min(520px,calc(100vw - 32px)); border:1px solid var(--line); border-radius:16px; padding:0; color:var(--text); background:#111827; box-shadow:var(--shadow); }
.service-dialog::backdrop { background:rgba(2,6,12,.78); backdrop-filter:blur(4px); }
.service-dialog form { display:grid; gap:16px; padding:24px; }
.service-dialog h2,.service-dialog p { margin:0; }
.service-dialog p { color:var(--muted); }
.service-dialog label { display:grid; gap:8px; font-weight:650; }
.service-dialog textarea { min-height:130px; }
@media(max-width:600px){.service-status{align-items:flex-start;flex-direction:column}.service-switch{width:100%;justify-content:space-between}}


.moderation-grid { grid-template-columns:repeat(2,minmax(0,1fr)); align-items:start; }
.moderation-card { display:grid; gap:18px; }
.moderation-card.banned { border-color:rgba(var(--red-rgb),.45); box-shadow:0 10px 35px #0003,0 0 28px rgba(var(--red-rgb),.08); }
.moderation-heading { display:flex; align-items:flex-start; justify-content:space-between; gap:20px; }
.moderation-heading h2,.moderation-heading p { margin:0; }
.moderation-heading p { margin-top:5px; color:var(--muted); }
.moderation-kicker { display:block; margin-bottom:4px; color:var(--blue); font-size:11px; font-weight:800; letter-spacing:.1em; text-transform:uppercase; }
.moderation-card.banned .moderation-kicker { color:var(--red); }
.moderation-note-footer { display:flex; align-items:center; justify-content:space-between; gap:12px; }
.moderation-note-footer span { color:var(--muted); font-size:12px; }
@media(max-width:850px){.moderation-grid{grid-template-columns:1fr}}
@media(max-width:520px){.moderation-heading{flex-direction:column}.moderation-heading .service-switch{width:100%;justify-content:space-between}}
