/*
 * npcCommandBuilder.css — panel "Buat perintah" NPC Editor (N3).
 * HP: lembar bawah. Layar lebar: panel mengambang di tengah bawah.
 * Token tema saja. Awalan: ne-cmd.
 */

.ne-cmd-sheet .bottom-sheet__body {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 4px 16px 20px;
  overflow-y: auto;
}

.ne-cmd-sheet .bottom-sheet__body > * { flex-shrink: 0; }

@media (min-width: 900px) {
  .ne-cmd-sheet {
    left: 50%;
    right: auto;
    bottom: 24px;
    width: min(560px, calc(100vw - 48px));
    max-height: min(80vh, 720px);
    margin-left: calc(min(560px, calc(100vw - 48px)) / -2);
    border-bottom: 1px solid var(--border-strong);
    border-radius: var(--radius-lg);
  }
  .ne-cmd-sheet .bottom-sheet__grip { display: none; }
}

/* ── Jenis perintah ───────────────────────────────────────────────────── */

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

.ne-cmd__tabpanel {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.ne-cmd__chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 36px;
  padding: 6px 12px;
  border: 1px solid var(--border-subtle);
  border-radius: 999px;
  background: var(--bg-inset);
  color: var(--text-secondary);
  font-size: var(--fs-sm);
  cursor: pointer;
}

.ne-cmd__chip:hover { background: var(--bg-hover); }

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

.ne-cmd__chip--active {
  border-color: var(--accent);
  background: var(--bg-active);
  color: var(--text-primary);
}

.ne-cmd__hint {
  margin: 0;
  font-size: var(--fs-sm);
  color: var(--text-muted);
}

/* ── Form ─────────────────────────────────────────────────────────────── */

.ne-cmd__form {
  display: grid;
  gap: 12px;
}

.ne-cmd__field { margin: 0; }

.ne-cmd__target {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 8px;
}

.ne-cmd__coords {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.ne-cmd__coords .text-input {
  min-width: 0;
  text-align: center;
  font-family: var(--font-mono);
}

.ne-cmd__search { position: relative; }

.ne-cmd__toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 36px;
  font-size: var(--fs-sm);
  color: var(--text-primary);
  cursor: pointer;
}

.ne-cmd__toggle input {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
}

.ne-cmd__more {
  justify-self: start;
  padding: 4px 0;
  border: 0;
  background: none;
  color: var(--accent);
  font-size: var(--fs-sm);
  cursor: pointer;
}

.ne-cmd__error {
  margin: 4px 0 0;
  font-size: var(--fs-xs);
  color: var(--status-error);
}

.ne-cmd__error:empty { display: none; }

.ne-cmd__field--invalid .text-input,
.ne-cmd__field--invalid .select-input { border-color: var(--status-error); }

/* ── Pratinjau & tombol ───────────────────────────────────────────────── */

.ne-cmd__preview {
  display: grid;
  gap: 6px;
  padding: 10px 12px;
  background: var(--bg-inset);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
}

.ne-cmd__line {
  font-family: var(--font-mono);
  font-size: var(--fs-sm);
  color: var(--text-primary);
  overflow-wrap: anywhere;
}

.ne-cmd__pending {
  margin: 0;
  font-size: var(--fs-sm);
  color: var(--text-muted);
}

.ne-cmd__warn {
  margin: 0;
  font-size: var(--fs-xs);
  color: var(--status-warn);
}

/* Tombol Sisipkan menempel di bawah lembar — terlihat tanpa menggulir. */
.ne-cmd__actions {
  position: sticky;
  bottom: -20px;
  display: flex;
  justify-content: flex-end;
  margin: 0 -16px -20px;
  padding: 10px 16px 16px;
  background: var(--wb-panel-raised, var(--bg-surface));
  border-top: 1px solid var(--border-subtle);
}

.ne-action__build {
  justify-self: start;
  margin-top: 6px;
  min-height: 36px;
  padding: 6px 12px;
  font-size: var(--fs-sm);
}
