/*
 * npcText.css — kolom teks NPC (N6): mode Teks biasa/Rawtext, penyusun
 * bagian rawtext, penghitung. Token tema saja. Awalan: ne-text, ne-rt.
 */

.ne-text {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.ne-text > * { flex-shrink: 0; }

.ne-text__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.ne-text__modes {
  display: inline-flex;
  padding: 2px;
  border: 1px solid var(--border-subtle);
  border-radius: 999px;
  background: var(--bg-inset);
}

.ne-text__mode {
  min-height: 28px;
  padding: 2px 12px;
  border: 0;
  border-radius: 999px;
  background: none;
  color: var(--text-muted);
  font-size: var(--fs-xs);
  cursor: pointer;
}

.ne-text__mode--active { background: var(--btn-primary-bg); color: var(--btn-primary-fg); }

.ne-text__mode:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.ne-text__warn:empty,
.ne-text__issues:empty { display: none; }

.ne-text__preview {
  margin: 0;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  background: var(--bg-inset);
  font-size: var(--fs-sm);
  color: var(--text-secondary);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

/* ── Penyusun rawtext ────────────────────────────────────────────────── */

.ne-rt {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.ne-rt > * { flex-shrink: 0; }

.ne-rt__part {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 8px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  background: var(--bg-inset);
}

.ne-rt__head {
  display: flex;
  align-items: center;
  gap: 4px;
}

.ne-rt__kind { flex: 1 1 auto; min-width: 0; }

.ne-rt__raw {
  flex: 1 1 auto;
  font-size: var(--fs-xs);
  color: var(--text-muted);
}

.ne-rt__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: var(--radius-sm);
  background: none;
  color: var(--text-muted);
  cursor: pointer;
}

.ne-rt__icon:hover:not(:disabled) { background: var(--bg-hover); color: var(--text-primary); }
.ne-rt__icon:disabled { opacity: 0.35; cursor: default; }

.ne-rt__body {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 6px;
}

.ne-rt__json {
  font-size: var(--fs-xs);
  overflow-wrap: anywhere;
}

.ne-rt__add {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.ne-action__label-format { margin-top: -4px; }
